-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
Integrate Android integration tests into CI pipeline #230
Conversation
Visit the preview URL for this PR (updated for commit 73419a2): https://sharezone-test--pr230-add-android-integrat-20ba6kx5.web.app (expires Sat, 08 Oct 2022 23:13:54 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
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.
See above.
Maybe also add a comment that we might chache the AVD image to make it start up faster? (See emulator-runner docs)?
.github/workflows/main.yml
Outdated
- name: Run integration tests | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
env: | ||
USER_1_EMAIL: ${{ secrets.INTEGRATION_TEST_USER_1_EMAIL }} | ||
USER_1_PASSWORD: ${{ secrets.INTEGRATION_TEST_USER_1_PASSWORD }} | ||
with: | ||
api-level: ${{ matrix.api-level }} | ||
target: ${{ matrix.target }} | ||
arch: ${{ matrix.arch }} | ||
profile: pixel_3a | ||
emulator-options: -no-snapshot -no-window -no-boot-anim -camera-back virtualscene -camera-front emulated | ||
working-directory: ./app | ||
# We can not use a multiline command because the | ||
# "android-emulator-runner" doesn't support it. It just takes every | ||
# line as separate command. | ||
script: flutter test integration_test --flavor dev --dart-define USER_1_EMAIL=$USER_1_EMAIL --dart-define USER_1_PASSWORD=$USER_1_PASSWORD |
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.
Kinda feel like we should put this into our Sharezone CLI in the future - this would also help to run integration tests locally.
We might even automatically retrieve the secrets inside the script (or at least make it nicer by reading from an .env
or sth)
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, we can integrate this later in the CLI 👍 But I would like to do a rework of the CLI first and do things like better styling when printing to the console and writing much more tests.
## Description For now, it was required to have a `key.properties` file with our code signing credentials when you tried to build for Android (even when running in debug mode where no code signing was done). We now check if a `key.properties` is present. If no, don't try to code sign the android app, which is the expected behavior because you need code signing only for publishing. This PR unblocks #230 Closes #234
Tests are failing because of:
Hmm, it seems so that we need to upgrade Firebase Messaging and Firebase Core to unblock this PR: https://stackoverflow.com/questions/69880191/missingpluginexceptionno-implementation-found-for-method-messagingrequestpermi |
This reverts commit bff3de4.
Just want to say that some android actions fail but because of an firebase auth error, e.g. https://github.com/SharezoneApp/sharezone-app/actions/runs/3160777863/jobs/5145617181 |
Visit the preview URL for this PR (updated for commit 63d1030): https://sharezone-test--pr230-add-android-integrat-or4aeld9.web.app (expires Fri, 03 Mar 2023 10:03:55 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 4cb3ae61e1e018abfd9841fd3239f5b49ccc034b |
Using |
⬇️ Generated builds by Codemagic for commit 63d1030 ⬇️ Note: Only Sharezone team members are able to install the iOS app.
|
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.
See nits above.
.github/workflows/main.yml
Outdated
# We use the `flutter drive` instead of the `flutter test` command | ||
# because the test command times out after 12 minutes. But building the | ||
# app takes more than 12 minutes... It seems so that there is no way to | ||
# set the timeout (the --timeout argument has not effect). Tracking | ||
# issue: https://github.com/flutter/flutter/issues/105913 | ||
script: flutter test integration_test --flavor dev --dart-define USER_1_EMAIL=$USER_1_EMAIL --dart-define USER_1_PASSWORD=$USER_1_PASSWORD |
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.
The comment is out-of-date (you're using flutter test
here, not flutter drive
)
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.
ah, thanks
.github/workflows/main.yml
Outdated
# We use some emulator options for the following reasons: | ||
# * "-no-boot-anim": Disables the boot animation for faster booting. | ||
# * "-no-window": Disables the graphical windows, so no display is | ||
# required. | ||
# * "-no-snapshot": Disables the quick boot feature. Therefore, the | ||
# emulator does not load or save the emulator state. We want to have | ||
# a fresh testing environment for every test run. | ||
# * "-camera-back virtualscene": Shows this virtual room when opening | ||
# the back camera where you can walk. Default option for emulators | ||
# created by Android Studio. We use this so we have the same | ||
# environment locally as when using this action. Is needed when | ||
# testing things with the camera. It's also possible to inject | ||
# images into the virtual scene to test things like qr code scanner. | ||
# * "-camera-front": Shows this green monster when opening the front | ||
# camera. Default option for emulators created by Android Studio. We | ||
# use this so we have the same environment locally as when using | ||
# this action. Is needed when testing things with camera. | ||
emulator-options: -no-snapshot -no-window -no-boot-anim -camera-back virtualscene -camera-front emulated |
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.
Teeny tiny nit: Could you use the same order for the emulator-options:
flags and for the comment above explaining them?
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.
Changed
Closes #176