Skip to content

Commit e53e8de

Browse files
committed
Add Android instrumentation test on emulator
1 parent 446bd7c commit e53e8de

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

.github/workflows/_android.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,17 @@ jobs:
6666
# avoid permission issue
6767
sudo chown -R "${USER}" /opt/android
6868
69+
- name: Download Artifacts
70+
shell: bash
71+
run: |
72+
set -eux
73+
curl -O https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/llm_demo/app-debug.apk
74+
curl -O https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/${{ github.run_id }}/artifacts/llm_demo/app-debug-androidTest.apk
75+
# TODO: Either export, or use persistent storage
76+
curl -O https://gha-artifacts.s3.amazonaws.com/${{ github.repository }}/11395155337/artifacts/stories110M_xnnpack/model.zip
77+
unzip model.zip
78+
mv *.pte model.pte
79+
6980
- name: Gradle cache
7081
uses: gradle/actions/setup-gradle@v3
7182

build/run_android_emulator.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,10 @@ $ADB_PATH wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; d
1818
echo "List all running emulators"
1919
$ADB_PATH devices
2020

21-
# TODO: Run tests on emulator here, atm the script only boots up the emulator
22-
# and exits without doing anything yet
21+
adb install -t app-debug.apk
22+
adb install -t app-debug-androidTest.apk
23+
24+
adb shell mkdir -p /data/local/tmp/llama
25+
adb push model.pte /data/local/tmp/llama
26+
adb push tokenizer.bin /data/local/tmp/llama
27+
adb shell am instrument -w -r com.example.executorchllamademo.test/androidx.test.runner.AndroidJUnitRunner

0 commit comments

Comments
 (0)