Skip to content

Reduce filename size for screenshot test #844

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 17, 2023
Merged

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Jul 11, 2023

For a better devX. Having long names is hiding the useful part of the name (the name of the View), for instance in PR review:

image

Now the names will look like:

image

This PR also contains small cleanup.

@bmarty bmarty requested a review from a team as a code owner July 11, 2023 12:30
@bmarty bmarty requested review from jmartinesp and removed request for a team July 11, 2023 12:30
@github-actions
Copy link
Contributor

github-actions bot commented Jul 11, 2023

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/EbjFQz

@codecov
Copy link

codecov bot commented Jul 11, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (cbf4f03) 57.02% compared to head (73bd05c) 57.02%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #844   +/-   ##
========================================
  Coverage    57.02%   57.02%           
========================================
  Files         1017     1017           
  Lines        25829    25819   -10     
  Branches      5187     5182    -5     
========================================
- Hits         14729    14724    -5     
  Misses        8821     8821           
+ Partials      2279     2274    -5     
Files Changed Coverage Δ
...id/libraries/designsystem/theme/components/Text.kt 77.90% <ø> (+2.90%) ⬆️
...s/src/main/kotlin/ui/ElementXShowkaseRootModule.kt 0.00% <ø> (ø)
...s/uitests/src/main/kotlin/ui/ShowkaseNavigation.kt 0.00% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -75,7 +75,7 @@ class ScreenshotTest {
)

@Test
fun preview_tests(
fun t(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make it clear with adequate comments why these methods and classes are named as such.

@@ -55,7 +55,7 @@ import java.util.Locale
* my own needs for this sample.
*/
@RunWith(TestParameterInjector::class)
class ScreenshotTest {
class T {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make it clear with adequate comments why these methods and classes are named as such.

@@ -15,7 +15,7 @@
* limitations under the License.
*/

package io.element.android.tests.uitests
package ui

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make it clear with adequate comments why these methods and classes are named as such.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I will comment, but I do not want to trigger the CI again for this. Will do in a later PR (I promise!).

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@@ -28,4 +28,8 @@ class ComponentTestPreview(
override val name: String = showkaseBrowserComponent.componentName

override fun toString(): String = showkaseBrowserComponent.componentKey
// Strip package (Preview MUST all have a distinct name)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep this as a last resort? There is noway to detect such clashes at compile time so it will degrade the devx.
Can we just strip the common io.element.android from the pacakge name for now?

Copy link

@julioromano julioromano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some other comments

@bmarty bmarty marked this pull request as draft July 17, 2023 09:29
@bmarty bmarty force-pushed the feature/bma/screenshotTest branch from 66ad170 to 4a01494 Compare August 17, 2023 16:43
@bmarty
Copy link
Member Author

bmarty commented Aug 17, 2023

I have updated the PR with including @julioromano 's remarks. I will merge it once CI is happy to avoid merge conflict on the screenshot tests.

@bmarty bmarty marked this pull request as ready for review August 17, 2023 16:45
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@bmarty bmarty merged commit 959e8d4 into develop Aug 17, 2023
@bmarty bmarty deleted the feature/bma/screenshotTest branch August 17, 2023 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants