-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
173 additions
and
32 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
name: Run android regression tests | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
APK_URL: | ||
description: 'APK.tar.gz url to test' | ||
required: true | ||
type: string | ||
default: https://oxen.rocks/oxen-io/session-android/release/1.19.0/session-android-20240807T060802Z-9cc760ce4-universal.tar.xz | ||
|
||
BRANCH_TO_CHECKOUT: | ||
description: 'bilb/session-appium branch to checkout' | ||
required: true | ||
type: string | ||
default: august | ||
|
||
SHARD_NUMBER: | ||
description: 'shard number' | ||
required: true | ||
type: string | ||
|
||
SHARD_COUNT: | ||
description: 'shard count' | ||
required: true | ||
type: string | ||
|
||
push: | ||
branches: | ||
- test-docker-container | ||
|
||
concurrency: | ||
group: ${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
android-regression: | ||
runs-on: [self-hosted, linux, x64, qa-android] | ||
env: | ||
ANDROID_APP_PATH_PREFIX: "../extracted/session-android.apk" | ||
APPIUM_ADB_FULL_PATH: "/opt/android/platform-tools/adb" | ||
ANDROID_SDK_ROOT: "/opt/android" | ||
PLAYWRIGHT_WORKERS_COUNT: 1 | ||
IOS_APP_PATH_PREFIX: "just_not_empty" | ||
IOS_FIRST_SIMULATOR: "just_not_empty" | ||
IOS_SECOND_SIMULATOR: "just_not_empty" | ||
IOS_THIRD_SIMULATOR: "just_not_empty" | ||
IOS_FOURTH_SIMULATOR: "just_not_empty" | ||
IOS_FIFTH_SIMULATOR: "just_not_empty" | ||
IOS_SIXTH_SIMULATOR: "just_not_empty" | ||
IOS_SEVENTH_SIMULATOR: "just_not_empty" | ||
IOS_EIGHTH_SIMULATOR: "just_not_empty" | ||
|
||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Runner Details | ||
run: | | ||
echo "BRANCH_TO_CHECKOUT ${{ github.event.inputs.BRANCH_TO_CHECKOUT }}" | ||
echo "APK_URL ${{ github.event.inputs.APK_URL }}" | ||
echo "SHARD_NUMBER ${{ github.event.inputs.SHARD_NUMBER }}" | ||
echo "SHARD_COUNT ${{ github.event.inputs.SHARD_COUNT }}" | ||
- name: Download APK | ||
run: | | ||
wget -q -O plop.apk.tar.xz ${{ github.event.inputs.APK_URL }} | ||
ls | ||
pwd | ||
- name: Extract APK | ||
run: | | ||
tar xf plop.apk.tar.xz | ||
ls | ||
pwd | ||
- name: Rename extracted folder | ||
run: | | ||
mv session-android-*universal extracted | ||
ls extracted | ||
mv extracted/*.apk extracted/session-android.apk | ||
ls extracted | ||
pwd | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: 'bilb/session-appium' | ||
ref: ${{ github.event.inputs.BRANCH_TO_CHECKOUT }} | ||
path: 'forked-session-appium' | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
# node-version-file: 'forked-session-appium/.nvmrc' | ||
node-version: 18.15.0 | ||
|
||
|
||
- name: Install yarn | ||
run: | | ||
npm install -g yarn | ||
corepack enable | ||
yarn set version 4.1.1 | ||
- name: Install test dependencies | ||
run: | | ||
cd forked-session-appium | ||
ls | ||
git status | ||
touch yarn.lock | ||
yarn install --immutable | ||
- name: Build the Android tests | ||
run: | | ||
cd forked-session-appium | ||
yarn tsc | ||
- name: Start 4 android emulators with snapshots | ||
shell: bash | ||
run: | | ||
for i in {1..4} \ | ||
do \ | ||
emulator @emulator$i -no-window -no-snapshot-save -snapshot plop.snapshot -force-snapshot-load & \ | ||
sleep 5 \ | ||
done | ||
- name: Run the Android tests | ||
if: always() | ||
run: | | ||
cd forked-session-appium | ||
pwd | ||
yarn test-android-shard ${{ github.event.inputs.SHARD_NUMBER }}/${{ github.event.inputs.SHARD_COUNT }} | ||
- name: Killall running emulators | ||
if: always() | ||
run: killall qemu-system-x86_64-headless | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# alias copy_snapshot="export SNS1='/home/runner/.android/avd/emulator1.avd/snapshots/plop.snapshot' && cp $SNS1 /home/runner/.android/avd/emulator2.avd/snapshots/plop.snapshot && cp $SNS1 /home/runner/.android/avd/emulator2.avd/snapshots/plop.snapshot && cp $SNS1 /home/runner/.android/avd/emulator2.avd/snapshots/plop.snapshot && cp $SNS1 /home/runner/.android/avd/emulator2.avd/snapshots/plop.snapshot && cp $SNS1 /home/runner/.android/avd/emulator2.avd/snapshots/plop.snapshot && cp $SNS1 /home/runner/.android/avd/emulator2.avd/snapshots/plop.snapshot && cp $SNS1 /home/runner/.android/avd/emulator2.avd/snapshots/plop.snapshot" | ||
|
||
for i in {2..8}; do unlink /home/runner/.android/avd/emulator$i.avd/snapshots/plop.snapshot; ln -s /home/runner/.android/avd/emulator1.avd/snapshots/plop.snapshot/ /home/runner/.android/avd/emulator$i.avd/snapshots/; done | ||
|
||
# alias start_for_snapshot="emulator @emulator1 -no-window" | ||
# alias save_snapshot="adb emu avd snapshot save plop.snapshot" | ||
# alias copy_snapshot="export SNS1='~/.android/avd/emulator1.avd/snapshots/plop.snapshot' && cp $SNS1 ~/.android/avd/emulator2.avd/snapshots/plop.snapshot && cp $SNS1 ~/.android/avd/emulator2.avd/snapshots/plop.snapshot && cp $SNS1 ~/.android/avd/emulator2.avd/snapshots/plop.snapshot && cp $SNS1 ~/.android/avd/emulator2.avd/snapshots/plop.snapshot && cp $SNS1 ~/.android/avd/emulator2.avd/snapshots/plop.snapshot && cp $SNS1 ~/.android/avd/emulator2.avd/snapshots/plop.snapshot && cp $SNS1 ~/.android/avd/emulator2.avd/snapshots/plop.snapshot" | ||
# alias start_with_snapshot="emulator @emulator1 -no-window -no-snapshot-save -snapshot plop.snapshot -force-snapshot-load" | ||
|
||
## start_for_snapshots | ||
for i in {1..4} | ||
do emulator @emulator$i -no-window & | ||
sleep 20 | ||
done | ||
|
||
|
||
# force save snapshots | ||
values=("5554" "5556" "5558" "5560" "5562" "5564" "5566" "5568") | ||
for val in "${values[@]}" | ||
do | ||
adb -s emulator-$val emu avd snapshot save plop.snapshot | ||
done | ||
|
||
alias killall_emulators="killall qemu-system-x86_64-headless;" | ||
|
||
|
||
# start with snapshots | ||
for i in {1..4} | ||
do | ||
emulator @emulator$i -no-window -no-snapshot-save -snapshot plop.snapshot -force-snapshot-load & | ||
sleep 5 | ||
done | ||
|
||
|
||
https://oxen.rocks/oxen-io/session-android/release/1.19.0/session-android-20240807T060802Z-9cc760ce4-universal.tar.xz |