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

Multiplatform: Port :zoomable module to Compose Multiplatform #17

Merged
merged 9 commits into from
May 30, 2023

Conversation

DSteve595
Copy link
Collaborator

#9

This adds a convention plugin for modules using Kotlin Multiplatform + Jetbrains Compose, and migrates the :zoomable module to use it.

Things to note:

  • The Compose compiler plugin is set to the AndroidX one rather than the Jetbrains one. I'm not sure if that matters.
  • AndroidX Compose libraries are still in libs.toml, but can (should) be removed once all modules are moved over.
  • Migrated :zoomable's build.gradle to KTS, since the Jetbrains Compose Gradle plugin adds some useful dependency declarations.
  • Only Android and Desktop targets are set up currently.
  • I'm not sure if I'm setting -Xjvm-default=all properly.
  • I migrated tests from Truth to kotlin.test, but that API is pretty basic. Now using assertk.

(This is a re-open of #10, which got lost when something weird happened to my fork)

@DSteve595 DSteve595 requested a review from saket May 17, 2023 21:51
@saket
Copy link
Owner

saket commented May 30, 2023

@DSteve595 can you rebase this PR? telephoto is now able to run screenshot tests in PRs too!

@emulator-wtf
Copy link

emulator-wtf bot commented May 30, 2023

:zoomable-image:core - Tests were flaky!

✅ 119 passed / ⚠️ 1 flaky

First failure encountered:

me.saket.telephoto.zoomable.ZoomableImageTest.various_image_sizes_and_alignments[BottomCenter,Fill,SmallerThanLayoutSize,FillMaxSize,SubSamplingEnabled] click for details

androidx.compose.ui.test.ComposeTimeoutException: Condition still not satisfied after 5000 ms
at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$AndroidComposeUiTestImpl.waitUntil(ComposeUiTest.android.kt:448)
at androidx.compose.ui.test.junit4.AndroidComposeTestRule.waitUntil(AndroidComposeTestRule.android.kt:306)
at me.saket.telephoto.util.WaitUntilKt.waitUntil-8Mi8wO0(waitUntil.kt:7)
at me.saket.telephoto.zoomable.ZoomableImageTest.various_image_sizes_and_alignments(ZoomableImageTest.kt:214)

There were more failures, click for details

@DSteve595
Copy link
Collaborator Author

@saket Done! Is that flaky test from my PR?

@saket
Copy link
Owner

saket commented May 30, 2023

Awesome! I don't think the flake was introduced here. I've been dealing with flakes for a while. They're proving really hard to solve.

@saket
Copy link
Owner

saket commented May 30, 2023

Huh, emulator-wtf is now saying one test failed despite posting a success message earlier. I'll rerun the tests.

cc @madisp

@saket saket merged commit 6b3e4fc into saket:trunk May 30, 2023
2 checks passed
@saket
Copy link
Owner

saket commented May 30, 2023

Thanks Steve!

@madisp
Copy link

madisp commented May 30, 2023

@saket hmm, I think this can happen if you have multiple modules and one of them succeeds at first (we don't know beforehand how many different module tests there can be so we can't really link them together like that) and another one fails later.

Ideally I'd like to figure out how to show GitHub checks for PR-triggered builds as well, that would have a stronger indication (you'd see some tests as running/queued first and you could make some set of checks as required via branch protection rules).

@DSteve595 DSteve595 deleted the multiplatform branch May 31, 2023 15:12
@saket
Copy link
Owner

saket commented Jun 2, 2023

@madisp Got it, thanks for explaining!

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.

None yet

3 participants