-
Notifications
You must be signed in to change notification settings - Fork 62
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
Using test parameter to feed BAAS URL to device farm #1642
Conversation
…n running Sync tests on Device Farm
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.
Nice 💯
.github/workflows/pr.yml
Outdated
run: | | ||
OUTPUT=$(bash cli.sh poll ${{ steps.baas_cli_start.outputs.baas_container_id }} | jq -r '.httpUrl') | ||
echo "baas_container_hostname=$OUTPUT" >> $GITHUB_OUTPUT | ||
|
||
- name: Build Android Sync Test Apk | ||
working-directory: packages | ||
run: ./gradlew -PsyncTestUrl=${{ steps.baas_cli_poll.outputs.baas_container_hostname }} :test-sync:packageDebug :test-sync:assembleAndroidTest -Prealm.kotlin.buildRealmCore=false -Prealm.kotlin.mainHost=false |
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.
Shouldn't we remove the syncTestUrl
from here?
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 catch 👍
val arguments: Bundle = InstrumentationRegistry.getArguments() | ||
// if the test runner provided an argument for the BAAS URL use it | ||
// Example: adb shell am instrument -w -e baas_url "http"//8.8.8.8:2134" -r io.realm.sync.testapp.test/androidx.test.runner.AndroidJUnitRunner | ||
return arguments.getString("baas_url") ?: SyncServerConfig.url |
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.
Nice solution to this 👍
- Fixing test
Using AndroidTestRunner to parametrise the URL of the BAAS server when running Sync tests on Device Farm. We now can replay the sync test without the need to rebuild the APK. see https://github.com/realm/realm-kotlin/actions/runs/7679635078/job/20931215946#step:8:43