Skip to content
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

Replace Accompanist TestHarness with DeviceConfigurationOverride #1230

Merged
merged 15 commits into from
Apr 15, 2024

Conversation

dturner
Copy link
Collaborator

@dturner dturner commented Feb 26, 2024

Compose UI 1.7.0-alpha02 added the DeviceConfigurationOverride API which replaces the Accompanist TestHarness API.

This mostly involves changing

TestHarness(size = DpSize(600.dp, 400.dp))

to

DeviceConfigurationOverride(
    DeviceConfigurationOverride.ForcedSize(DpSize(600.dp, 400.dp)),
)

Full migration guide here.

I have:

  • Replaced all instances of TestHarness with DeviceConfigurationOverride
  • Removed the testharness library

Fixes #1201

dturner and others added 3 commits February 26, 2024 13:46
Change-Id: I838b81bf8e7fd7cb135f422653a8d8041829b28b
Change-Id: I6742d5e221f86a019f44d3e623609bf76d2a3a2a
@dturner dturner self-assigned this Feb 26, 2024
dturner and others added 3 commits February 26, 2024 18:52
Change-Id: Ib1bbe4ad0d823c632d387587aa55c5eeb39e4b8d
Change-Id: Ibf93c1b65250e6527e34bc90602c1b1001b2df46
…i/NiaAppScreenSizesScreenshotTests.kt

Co-authored-by: Alex Vanyo <vanyo@google.com>
@dturner dturner force-pushed the replace-testharness branch from 77ef6e7 to 6810e48 Compare March 6, 2024 09:19
* main: (37 commits)
  Disable animations of instrumented tests (#1167)
  Bump gradle/wrapper-validation-action from 1 to 2
  Remove unused release variable. Fixes #1231
  Apply Composable Parameter Ordering Guidelines
  Remove kotlinx-coroutines-guava dependency from :sync:work
  Add explicit guava-android dependency for :sync:work
  Extract ScreenshotHelper to separate testing module
  Update AGP to 8.3.0
  Remove Insert function - Insert is only used in test. - Upsert do same thing as Insert.
  🤖 Updates baselines for Dependency Guard
  Bump the kotlin-ksp-compose group with 6 updates
  🤖 Updates baselines for Dependency Guard
  Bump hilt from 2.50 to 2.51
  Bump com.google.truth:truth from 1.1.5 to 1.4.2
  Move java to kotlin folder.
  Remove disk usage testing
  Figuring out what is using 66Gb in the runner
  Dpm
  Improve converting to kotlin timezone
  Use trySend multiple times
  ...

Change-Id: If3f564108d42675ba55ef242f0d06f04aff45c4a
@dturner dturner force-pushed the replace-testharness branch from 6810e48 to 2d610b0 Compare March 6, 2024 10:04
dturner and others added 4 commits March 28, 2024 10:20
Change-Id: I335f9f5da1ff3f2574acca8e3fcb27b949a07c7a
Change-Id: I98a9b9fa1de5cc0bb3a3caa7d795053fd784b238
@jdkoren
Copy link
Contributor

jdkoren commented Apr 12, 2024

Instrumented tests fail when I check out the code and run them locally. Is there a way to kick Github Actions? "Show all checks" is only showing the cla/google check, I don't see the one which actually builds & tests.

@SimonMarquis
Copy link
Contributor

SimonMarquis commented Apr 12, 2024

@jdkoren this is because of this issue:

If you want to check previous builds, you can click the ❌ next to the commit id in this page.
For example, the latest is:

@dturner
Copy link
Collaborator Author

dturner commented Apr 15, 2024

Instrumented tests are failing with:

java.lang.NoSuchMethodError: No static method rememberComposableLambda

Root cause: rememberComposableLambda is only available in compose-runtime:1.7.0-alpha06.

Updating to compose-ui:1.7.0-alpha06 fixed the issue.

dturner and others added 3 commits April 15, 2024 17:38
Copy link

Combined test coverage report

Overall Project 40.19% -0.04% 🍏
Files changed 74.76% 🍏

Module Coverage
designsystem 32.01% 🍏
app 29.47% -0.19% 🍏
Files
Module File Coverage
designsystem NiaIcons.kt 80.22% 🍏
app NiaApp.kt 84.73% -1.21% 🍏

@dturner dturner merged commit b993536 into main Apr 15, 2024
4 checks passed
@dturner dturner deleted the replace-testharness branch April 15, 2024 18:20
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.

Replace testharness with DeviceConfigurationOverride
4 participants