-
Notifications
You must be signed in to change notification settings - Fork 119
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
Allow APKs with zero tests without throwing an exception #741
Conversation
I think invalid APKs should throw an exception. APKs with zero tests should be filtered out entirely and not uploaded to gcloud. |
apk validation is done server side by FTL, we don't have a great way to detect if an APK is valid on the client. We can detect the test counts client side though. |
Didn't know that, nice to know.
Agree, in case we can still do a light validation as optimization counting the dex files through |
I can't trust DexParser in the future though, that's why disable sharding was added. That code path completely bypasses dex parser. The Android bytecode evolves. I removed the APK validation check because when dex parser breaks, we need a release valve that doesn't involve being able to read the bytecode. The hypershard example we're working on is related. |
Understood, thanks for the explanation. BTW, let me know if you want me to make some changes to this PR. |
Thanks! I will let @pawelpasterz and @jan-gogo review the code. We're trying to make sure there's at least two engineers looking at incoming pull requests. The code looks reasonable. |
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.
Thanks for contributing!
Remember to update https://github.com/Flank/flank/blob/master/release_notes.md
:)
test_runner/src/main/kotlin/ftl/run/platform/RunAndroidTests.kt
Outdated
Show resolved
Hide resolved
test_runner/src/main/kotlin/ftl/run/platform/RunAndroidTests.kt
Outdated
Show resolved
Hide resolved
# Conflicts: # release_notes.md
Description
This PR is a follow-up of our discussion on Slack about supporting APKs with zero tests.
Issue: #739
Motivation
This behaviour can be useful for projects with several Android modules.
Usually, in big projects, Flank is configured automatically on each Android module. Not configuring it automatically would be dangerous since you usually want to run all your tests on the CI without forgetting some of them.
Important notes
When the sharding is disabled, Flank already supported zero tests APK, since it supported invalid APKs. To be coherent with it, I reproduced the same behaviour when the sharding is enabled.
However, IMHO, it would be useful to distinguish an invalid APK from an APK with zero tests, regardless of whether the sharding is enabled or not. What do you think about this? In case, I could work on that too in another PR.