-
Notifications
You must be signed in to change notification settings - Fork 269
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
test(android): add instrumentation test github action #4178
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
Terraform Cloud Plan Output
|
Performance Test ResultsTCP
UDP
|
@jasonboukheir should this be wrapped up and reviewed or be closed you think? |
Found a nifty utility for e2e ui testing. There's a way to record an Espresso test in Android Studio. It's under Run > Record Espresso Test |
It should be g2g for review now as long as the smoke tests can pass |
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.
Good foundation. You need to rebase off main
and looks like you have a failing test.
b53d3cb
to
84c6156
Compare
ui-test: | ||
name: ui-test-api-${{ matrix.api-level }} |
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.
Calling it a ui-test
because that has specific meaning in an android context. See: https://developer.android.com/training/testing/instrumented-tests/ui-tests
Other UI tests can base it off of this :)
7e37bdf
to
e6f8edc
Compare
There are some issues with the synchronization of the tests... Espresso is complicated... |
e6f8edc
to
679fba2
Compare
I've gone back and forth on how to handle the delay in the splash screen. Originally, I checked with a timeout for the
Searching that up online reveals that this can occur when there is a popup window in android that doesn't belong to the application. I tried following solutions in the stack exchange, but the tests were still failing. Trying Option 2So I tried a different route, to manage the delay by injecting coroutine scopes. I used a custom However, I was unable to get the Going back to Option 1At the end of the comments in Kotlin/kotlinx.coroutines#242, there is a point to avoid using a custom dispatcher with delay calls, since they are usually reserved for things that intentionally do not idle (hence they should not be treated as an idling resource). The suggestion is to wait for the view to show up, similar to how I was doing it originally. I went back to option 1 and was back to the original issue I was facing. The solution (for now)I noticed that tests tended to fail based on the state of the android emulator, so I tried removing the AVD cache step in the flow. This caused the test to take longer to run, but it doesn't fail anymore with that obscure error about finding a root view. |
Sorry... I spoke too soon... test is still very flaky 🤯 |
94bfc97
to
a8e87a9
Compare
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.
LGTM, just a question about CI cleanup. Trying to keep the number of CI dependencies low to reduce supply chain surface.
- name: Free Disk Space (Ubuntu) | ||
uses: jlumbroso/free-disk-space@main | ||
with: | ||
tool-cache: false | ||
android: false | ||
dotnet: true | ||
haskell: true | ||
large-packages: false | ||
swap-storage: true |
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.
Is this still needed?
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.
Yes, I run into issues with space on the runners
@jasonboukheir Unfortunately this is still flaky: https://github.com/firezone/firezone/actions/runs/8955104222/job/24595479753?pr=4887 I'm going to disable this test for now. Could you spend a bit more time making it robust? I disabled the API 26 test because it was timing out, but it looks like the API 29 one randomly times out as well, so we would want to fix that too. Thanks in advance! |
Fixes #2311