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
Fix android tests #217
Fix android tests #217
Conversation
…sabled (cherry picked from commit 54b2db8)
…d ones that don't run
val natasha = Person("Scarlett Johansson", "Natasha Romanoff", "", Gender.FEMALE) | ||
val hermione = Person("Emma Watson", "Hermione Granger", "", Gender.FEMALE) | ||
val sparrow = Person("Johnny Depp", "Jack Sparrow", "", Gender.MALE) | ||
val tony = Person("Al Pacino", "Tony Montana", null, Gender.MALE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you don't set the URL to null, you'll get a ComposeIdleException because Coil never goes into idle.
|
||
data class Credits(val cast: List<Person>, val crew: List<Person>) | ||
data class Credits(@Stable val cast: List<Person>, @Stable val crew: List<Person>) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lists in Kotlin are mutable so Compose won't know these are immutable w/ the @stable annotation. This helped the assertPeople() check get a little bit further (manages to scroll to the 2nd position, but then hangs reading the text values)
@@ -35,6 +35,7 @@ compose_paging = { module = "androidx.paging:paging-compose", version = "1.0.0-a | |||
compose_activity = { module = "androidx.activity:activity-compose", version = "1.7.0-alpha01" } | |||
compose_viewModel = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version = "2.6.0-alpha02" } | |||
compose_navigation = { module = "androidx.navigation:navigation-compose", version = "2.6.0-alpha02" } | |||
compose_navigation_testing = { module = "androidx.navigation:navigation-testing", version = "2.6.0-alpha03" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this testing artifact is needed for the testing.navController in the latest Compose libs
Hi @kenyee, first of all, thanks for your effort in the UI test part. I am completely aware that for a while UI tests are failing and I didn't fix them intentionally. This pr will save the day for now but they won't build on a future change that breaks UI tests. I've been searching/experimenting with the ways that I can run UI tests on GitHub CI or another CI, so androidTests will run on every PR, will fail automatically and On this branch I am still experimenting: 111cb88 |
I think I fixed more things in this PR 😄 It's totally possible to set up android tests on github actions FYI. |
@kenyee Yes, it is updated locally but I haven't pushed it to the repo. Thanks for the link, yes it is possible to have UI tests on GitHub Actions. I even tried https://github.com/cashapp/paparazzi just to have a faster option .(I still prefer actual tests running on CI) |
Sounds good. |
It was hanging on Github Actions as well(If I don't give timeout it can run forever). |
That's a strange hanging fix...not sure what would have caused it from those changes. If I have time, I'll see if I can figure out which bit fixed it. |
Yes, strange fix for me as well 😄 . It is these lines(Actually only
|
That makes a little more sense...probably a bug in the emulator support for that in AGP. Maybe hidden permissions issue writing to storage on the device from the test runner. |
confirmed that fixed it for me too...that's a bizarre AGP bug... |
Had a bit of time to follow up on creating b.android.com bug reports:
|
Hello again @kenyee, I've opened a pull request that fixes UI Tests and adds UI test GitHub action that runs on every pr. I have a dilemma about duration and host:
Since macOS minutes multiplied by 10 on Github actions: https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#minute-multipliers Apart from that decision, everything looks fine from my side. |
I'd suggest leaving it on Linux. You would get 5x as many PRs through it per month. The 10x multiplier is too much. Interesting that the cast/crew tests work fine in your branch but not mine, even after I used a valid URL 🤔 |
Yes, it is reasonable to leave it on Linux. IMHO, no need to depend on Unit tests, since it takes a long time to finish any additional waiting time will affect pull requests. I am making some changes regarding performance, so I intend to keep UI tests as is if they won't fail. Also, I will add cancel logic on actions, whenever a pull request gets a new push or force push, it will cancel already running checks and start new ones. |
I've merged the pr: #218 |
The current Jetflix android tests don't build properly from the last library update. Looks like CI only runs unit tests on github?
This PR fixes the compilation errors.
Also, the cast/crew tests are broken...they don't wait for the cast/crew sections to display. When adding enough delays for them, the assertPeople check seems to hang with a ComposeIdleException when going through the lazyrow.
Also, running on command line via the command "./gradlew connectedAndroidTest" hangs for me....seems like it installs the app but then doesn't run the tests.