Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/instrumentation_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Instrumentation tests
on: [pull_request, workflow_dispatch]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
api-level: [ 31, 35 ]
target: [ default, google_apis ]
steps:
- name: checkout
uses: actions/checkout@v4

- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm

- name: run tests
id: run_tests
uses: reactivecircus/android-emulator-runner@v2
continue-on-error: true
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: x86_64
profile: pixel_7_pro
script: |
adb shell 'echo "_ --disable-fre --no-default-browser-check --no-first-run" > /data/local/tmp/chrome-command-line'
adb shell chmod 777 /data/local/tmp/chrome-command-line
./gradlew :demo:connectedCheck --stacktrace

- name: retry tests
if: steps.run_tests.outcome == 'failure'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: x86_64
profile: pixel_7_pro
script: |
adb shell 'echo "_ --disable-fre --no-default-browser-check --no-first-run" > /data/local/tmp/chrome-command-line'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you mind giving me some context why we needed to add shell commands to our running script, I am just curious.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep! Of course: This is to get around the first time Chrome is launched bring up the "Terms of Service" popup that blocks the text the test is looking for, so it essentially launches Chrome as if it has already been launched before

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh, smart!

adb shell chmod 777 /data/local/tmp/chrome-command-line
./gradlew :demo:connectedCheck --stacktrace
Loading