saket / telephoto

Building blocks for designing media experiences in Compose UI
https://saket.github.io/telephoto/
Apache License 2.0
935 stars 29 forks source link

Multiplatform: Port :zoomable module to Compose Multiplatform #17

Closed DSteve595 closed 1 year ago

DSteve595 commented 1 year ago

9

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

Things to note:

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

saket commented 1 year ago

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

emulator-wtf[bot] commented 1 year ago

:zoomable-image:core - Tests were flaky!

:white_check_mark: 119 passed / :warning: 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 - [:zoomable-image:sub-sampling-image - test failures](https://emulator.wtf/r/4e17fd75-44f2-4d46-be63-ee32b5a82631?key=Q2jaCBsdK6v41GSQtDBAoE-lP6vZaaC7imI2da9a)
DSteve595 commented 1 year ago

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

saket commented 1 year ago

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 commented 1 year ago

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

cc @madisp

saket commented 1 year ago

Thanks Steve!

madisp commented 1 year ago

@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).

saket commented 1 year ago

@madisp Got it, thanks for explaining!