-
Notifications
You must be signed in to change notification settings - Fork 902
[QA-1126] Adding sanity check against real devices for Prod builds #5526
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
base: main
Are you sure you want to change the base?
Conversation
This reverts commit 4b2f0da.
c6058a3 to
62b9088
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5526 +/- ##
=======================================
Coverage 84.40% 84.40%
=======================================
Files 719 719
Lines 54764 54765 +1
Branches 7528 7528
=======================================
+ Hits 46226 46227 +1
Misses 5897 5897
Partials 2641 2641 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Can the androidTest files be put in com.x8bit.bitwarden.* packages? I.e., com.x8bit.bitwarden.data.TestData.kt and com.x8bit.bitwarden.e2e.*.
| implementation(libs.androidx.uiautomator) | ||
| implementation(libs.androidx.espresso.core) | ||
| implementation(libs.androidx.junit.ktx) | ||
| implementation(libs.androidx.ui.test.junit4.android) |
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.
Can we remove these as implementation dependencies?
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.
For some reason, the build fails if I remove those dependencies 🤔
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.
I think he want's them to be an androidTestImplementation to avoid having these test dependencies in the non-test builds
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.
Yeah, but those deps are already present as androidTestImplementation in lines 302-306.
Apart from that, we need those deps in non-test builds since we aim to test the release build on real devices
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.
🤔 We do not want to ship with unnecessary dependencies like this. Is there a specific error you are seeing?
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.
I couldn't find a way to build the required testApp without those deps 🫤
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.
Maybe we need a new variant for this.
app/src/androidTest/kotlin/e2e/pageObjects/login/EnvironmentSettingsPage.kt
Outdated
Show resolved
Hide resolved
1f61ab4 to
a4b464c
Compare
a4b464c to
f803752
Compare
7d32d32 to
bb8dda4
Compare
| # Keep Kotlin standard library classes | ||
| -keep class kotlin.** { *; } | ||
| -keep class kotlinx.** { *; } | ||
| -keep class kotlin.io.** { *; } |
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.
Why do we need this?
Are we obfuscating test code?
eabd248 to
2cb6a6a
Compare
2cb6a6a to
da9b60f
Compare
| # TODO: test if bundle exec fastlane assembleTestApk works and replace this step | ||
| # - name: Sign and rename test APK | ||
| # if: ${{ (matrix.variant == 'prod') && (matrix.artifact == 'apk') }} | ||
| # env: | ||
| # _TEST_APK_PATH: app/build/outputs/apk/androidTest/standard/release/com.x8bit.bitwarden-standard-release-androidTest.apk | ||
| # _TEST_APK_SIGNED_PATH: app/build/outputs/apk/androidTest/standard/release/com.x8bit.bitwarden-test.apk | ||
| # _PLAY_KEYSTORE_PASSWORD: ${{ steps.get-kv-secrets.outputs.PLAY-KEYSTORE-PASSWORD }} | ||
| # _PLAY_KEYSTORE_ALIAS: ${{ steps.get-kv-secrets.outputs.PLAY-KEYSTORE-ALIAS }} | ||
| # run: | | ||
| # $ANDROID_SDK_ROOT/build-tools/34.0.0/apksigner sign \ | ||
| # --ks keystores/app_play-keystore.jks \ | ||
| # --ks-key-alias bitwarden \ | ||
| # --ks-pass pass:$_PLAY_KEYSTORE_PASSWORD \ | ||
| # --key-pass pass:$_PLAY_KEYSTORE_PASSWORD \ | ||
| # $_TEST_APK_PATH | ||
| # mv $_TEST_APK_PATH $_TEST_APK_SIGNED_PATH | ||
|
|
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 TODO and commented code still needed? If so, can we associate it to a ticket so it isn't forgotten?
| test-device: | ||
| name: Test device | ||
| needs: publish_playstore | ||
| uses: bitwarden/android/.github/workflows/test-device.yml@QA-1126b/adding-native-sanity-test #TODO replace branch with main before merging |
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 TODO needs to be addressed.
| permissions: | ||
| contents: read | ||
| actions: read | ||
| checks: write |
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.
checks: write is only needed to create or update status checks. Neither are happening directly in the job, that I can see. I don't think this permission is needed.
🎟️ Tracking
📔 Objective
This PR streamlines and enhances our CI/CD pipeline by allowing the execution of sanity checks on real devices in our main build workflow.
It includes all necessary setup, secret retrieval, and artifact management to support E2E testing against real devices using SauceLabs.
📸 Screenshots
⏰ Reminders before review
🦮 Reviewer guidelines
:+1:) or similar for great changes:memo:) or ℹ️ (:information_source:) for notes or general info:question:) for questions:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:) for suggestions / improvements:x:) or:warning:) for more significant problems or concerns needing attention:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt:pick:) for minor or nitpick changes