Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
3c57584
refactor: no more 4 device tests
Miki-Session Aug 8, 2025
a1c31ff
feat: add mac to setup script
Miki-Session Aug 28, 2025
0ae81ca
fix: macos specific commands, different apis
Miki-Session Aug 28, 2025
dc087ec
feat: let tests run on macos runner
Miki-Session Aug 29, 2025
2e2593e
feat: bump to node 20 to resolve fetch issues
Miki-Session Aug 29, 2025
9a056b6
fix: ensure lfs screenshots are always pulled
Miki-Session Sep 11, 2025
e201f45
wip: tidy up PR
Miki-Session Sep 11, 2025
27d25bd
feat: allow ios tests to run 4 workers
Miki-Session Sep 12, 2025
cfe9f23
fix: simplify android workflow with composite action
Miki-Session Sep 15, 2025
c2c6ae9
fix: correct composite action name
Miki-Session Sep 15, 2025
32e43aa
feat: simplify logging
Miki-Session Sep 15, 2025
597cc00
chore: linting
Miki-Session Sep 15, 2025
11ca0fb
fix: simplify logging
Miki-Session Sep 15, 2025
d10d94d
feat: mac emulators to start from cold boot
Miki-Session Sep 15, 2025
bca639b
fix: no default value needed
Miki-Session Sep 15, 2025
063cae7
chore: cleanup
Miki-Session Sep 15, 2025
35ce679
fix: simplify workflow files
Miki-Session Sep 15, 2025
df4846b
chore: update env.sample
Miki-Session Sep 15, 2025
4ffbd85
fix: add back check if tests failed
Miki-Session Sep 15, 2025
b26477e
chore: linting
Miki-Session Sep 15, 2025
97ec289
chore: update README.md
Miki-Session Sep 15, 2025
437ac09
chore: update Readme.md
Miki-Session Sep 15, 2025
16555f1
fix: patch failing tests on macos emulators
Miki-Session Sep 15, 2025
a437c34
fix: bump looksSame tolerance
Miki-Session Sep 15, 2025
ea20375
handle API 34 and 35 Photos app
Miki-Session Sep 15, 2025
7b60df3
fix: re-add failed tests check
Miki-Session Sep 15, 2025
1b8d2d6
chore: linting
Miki-Session Sep 15, 2025
606f95a
fix: review tests close settings now
Miki-Session Sep 15, 2025
aaaeaad
Merge remote-tracking branch 'origin/dev' into feat/android-ci-macos
Miki-Session Oct 7, 2025
6780a80
fix: adjust action env
Miki-Session Oct 7, 2025
648128c
chore: update readme.md
Miki-Session Oct 7, 2025
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
17 changes: 10 additions & 7 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# this is a sample .env file. Copy it to .env, and edit the .env file to match your needs.

# Test binaries
ANDROID_APK=/home/yougotthis/Downloads/session-android-universal.apk
IOS_APP_PATH_PREFIX=/home/yougotthis/Downloads/Session.app
SDK_MANAGER_FULL_PATH=/home/yougotthis/Android/Sdk/cmdline-tools/latest/bin/sdkmanager
AVD_MANAGER_FULL_PATH=/home/yougotthis/Android/Sdk/cmdline-tools/latest/bin/avdmanager
EMULATOR_FULL_PATH=/home/yougotthis/Android/Sdk/emulator/emulator

# Environment variables
ANDROID_SDK_ROOT=/home/yougotthis/Android/Sdk
ANDROID_SYSTEM_IMAGE="system-images;android-35;google_atd;x86_64"
APPIUM_ADB_FULL_PATH=/home/yougotthis/Android/sdk/platform-tools/adb
PRINT_TEST_LOGS=true
PRINT_ONGOING_TEST_LOGS = 1

# Playwright and reporting
PRINT_ONGOING_TEST_LOGS=1
PRINT_FAILED_TEST_LOGS=1
PLAYWRIGHT_RETRIES_COUNT=0
PLAYWRIGHT_REPEAT_COUNT=0
PLAYWRIGHT_WORKERS_COUNT=1
PLAYWRIGHT_WORKERS_COUNT=1
CI=0
ALLURE_ENABLED='false'
139 changes: 92 additions & 47 deletions .github/workflows/android-regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ run-name: '${{ inputs.RISK }} regressions on ${{ github.head_ref || github.ref }
on:
workflow_dispatch:
inputs:
RUNNER:
description: 'Which runner to use'
required: true
type: choice
options:
- 'linux'
- 'mac'
default: 'linux'
APK_URL:
description: 'apk url to test (.tar.xz)'
required: true
Expand Down Expand Up @@ -55,18 +63,20 @@ on:

jobs:
android-regression:
runs-on: [self-hosted, linux, X64, qa-android]
runs-on: ${{ github.event.inputs.RUNNER == 'mac' && fromJSON('["self-hosted", "macOS"]') || fromJSON('["self-hosted", "linux", "X64", "qa-android"]') }}
env:
PLATFORM: 'android'
EMULATOR_COUNT: ${{ github.event.inputs.RUNNER == 'mac' && '6' || '4' }} # macOS runner can support 6 emulators, linux runner only 4
WORKERS_1_DEVICE: ${{ github.event.inputs.RUNNER == 'mac' && '6' || '4' }} # 6 or 4 workers, 1 device each
WORKERS_2_DEVICE: ${{ github.event.inputs.RUNNER == 'mac' && '3' || '2' }} # 3 or 2 workers, 2 devices each
WORKERS_3_DEVICE: ${{ github.event.inputs.RUNNER == 'mac' && '2' || '1' }} # 2 or 1 worker(s), 3 devices each
APK_URL: ${{ github.event.inputs.APK_URL }}
BUILD_NUMBER: ${{ github.event.inputs.BUILD_NUMBER }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CI: 1
ALLURE_ENABLED: ${{ github.event.inputs.ALLURE_ENABLED}}
IOS_APP_PATH_PREFIX: '<just_not_empty>'
ANDROID_APK: './extracted/session-android.apk'
APPIUM_ADB_FULL_PATH: '/opt/android/platform-tools/adb'
ANDROID_SDK_ROOT: '/opt/android'
PLAYWRIGHT_RETRIES_COUNT: ${{ github.event.inputs.PLAYWRIGHT_RETRIES_COUNT }}
_TESTING: 1 # Always hide webdriver logs (@appium/support/ flag)
PRINT_FAILED_TEST_LOGS: ${{ github.event.inputs.LOG_LEVEL != 'minimal' && '1' || '0' }} # Show stdout/stderr if test fails (@session-foundation/playwright-reporter/ flag)
Expand All @@ -77,6 +87,40 @@ jobs:
with:
lfs: true

# This is necessary because the macOS runner was not always pulling the lfs files despite checkout with lfs: true
# Check if LFS files were actually pulled
- name: Verify LFS files
run: |
echo "Ensuring all LFS screenshot files are downloaded..."
git lfs pull --include="run/screenshots/**/*.png"

echo "=== Verifying screenshot files ==="
corrupted_files=0
total_files=0

for file in run/screenshots/**/*.png; do
if [[ -f "$file" ]]; then # Make sure file exists (in case glob doesn't match anything)
((total_files++))
if file "$file" | grep -q "PNG image"; then
echo "✅ $file"
else
echo "⚠️ WARNING: $file is not a PNG image - related tests may fail"
# Show what it actually is for debugging
echo " File type: $(file "$file")"
((corrupted_files++))
fi
fi
done

echo "📊 Screenshot verification: $((total_files - corrupted_files))/$total_files files valid"

if [ $corrupted_files -gt 0 ]; then
echo "⚠️ Found $corrupted_files corrupted screenshot files"
echo "📝 Tests using these files will be skipped or may fail"
else
echo "✅ All screenshot files are valid PNG images"
fi

- name: Fetch result history from gh-pages
uses: ./github/actions/fetch-allure-history
if: ${{ env.ALLURE_ENABLED == 'true' }}
Expand All @@ -95,7 +139,7 @@ jobs:
- name: Download APK & extract it
run: |
pwd
wget -q -O session-android.apk.tar.xz ${{ github.event.inputs.APK_URL }}
curl -L -o session-android.apk.tar.xz ${{ github.event.inputs.APK_URL }}
tar xf session-android.apk.tar.xz
mv session-android-*universal extracted

Expand All @@ -118,72 +162,79 @@ jobs:
continue-on-error: true # just so we don't fail if adb wasn't already running
run: |
source ./scripts/ci.sh
echo "ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT}" >> $GITHUB_ENV
adb kill-server;
adb start-server;

- name: Start emulators from snapshot
- name: Start emulators
shell: bash
run: |
run: | # macOS can handle cold boot, linux cannot
source ./scripts/ci.sh
start_with_snapshots
if [[ "${{ github.event.inputs.RUNNER }}" == "mac" ]]; then
start_for_snapshots
else
start_with_snapshots
fi
wait_for_emulators

- name: List tests part of this run
uses: ./github/actions/list-tests
with:
PLATFORM: ${{ env.PLATFORM }}
RISK: ${{ github.event.inputs.RISK }}

- name: Run the 1-devices tests ​​with 4 workers
continue-on-error: true
id: devices-1-test-run
env:
PLAYWRIGHT_WORKERS_COUNT: 4
DEVICES_PER_TEST_COUNT: 1
- name: Run 1-device tests
id: test-1-device
uses: ./github/actions/run-tests
with:
PLATFORM: ${{ env.PLATFORM }}
RISK: ${{ github.event.inputs.RISK }}
WORKERS_COUNT: ${{ env.WORKERS_1_DEVICE }}
DEVICES_PER_TEST: 1
_TESTING: ${{ env._TESTING }}
PRINT_FAILED_TEST_LOGS: ${{ env.PRINT_FAILED_TEST_LOGS }}
PRINT_ONGOING_TEST_LOGS: ${{ env.PRINT_ONGOING_TEST_LOGS }}
run: |
pwd
npx playwright test --grep "(?=.*@${PLATFORM})(?=.*@${DEVICES_PER_TEST_COUNT}-devices)(?=.*@${{ github.event.inputs.RISK }})" #Note: this has to be double quotes

- name: Upload results of this run
- name: Upload 1-device test results
uses: ./github/actions/upload-test-results
with:
PLATFORM: ${{ env.PLATFORM }}
UPLOAD_IDENTIFIER: 'devices-1-test-run'

- name: Run the 2-devices tests ​​with 2 workers
continue-on-error: true
id: devices-2-test-run
env:
PLAYWRIGHT_WORKERS_COUNT: 2
DEVICES_PER_TEST_COUNT: 2
UPLOAD_IDENTIFIER: devices-1-test-run

- name: Run 2-device tests
id: test-2-device
uses: ./github/actions/run-tests
with:
PLATFORM: ${{ env.PLATFORM }}
RISK: ${{ github.event.inputs.RISK }}
WORKERS_COUNT: ${{ env.WORKERS_2_DEVICE }}
DEVICES_PER_TEST: 2
_TESTING: ${{ env._TESTING }}
PRINT_FAILED_TEST_LOGS: ${{ env.PRINT_FAILED_TEST_LOGS }}
PRINT_ONGOING_TEST_LOGS: ${{ env.PRINT_ONGOING_TEST_LOGS }}
run: |
pwd
npx playwright test --grep "(?=.*@${PLATFORM})(?=.*@${DEVICES_PER_TEST_COUNT}-devices)(?=.*@${{ github.event.inputs.RISK }})" #Note: this has to be double quotes

- name: Upload results of this run
- name: Upload 2-device test results
uses: ./github/actions/upload-test-results
with:
PLATFORM: ${{ env.PLATFORM }}
UPLOAD_IDENTIFIER: 'devices-2-test-run'

- name: Run the other tests with 1 worker
continue-on-error: true
id: other-devices-test-run
env:
PLAYWRIGHT_WORKERS_COUNT: 1
DEVICES_PER_TEST_COUNT: 4
UPLOAD_IDENTIFIER: devices-2-test-run

- name: Run 3-device tests
id: test-3-device
uses: ./github/actions/run-tests
with:
PLATFORM: ${{ env.PLATFORM }}
RISK: ${{ github.event.inputs.RISK }}
WORKERS_COUNT: ${{ env.WORKERS_3_DEVICE }}
DEVICES_PER_TEST: '3'
_TESTING: ${{ env._TESTING }}
PRINT_FAILED_TEST_LOGS: ${{ env.PRINT_FAILED_TEST_LOGS }}
PRINT_ONGOING_TEST_LOGS: ${{ env.PRINT_ONGOING_TEST_LOGS }}
run: |
pwd
npx playwright test --grep "(?=.*@${PLATFORM})(?=.*@${{ github.event.inputs.RISK }})" --grep-invert "@1-devices|@2-devices" #Note: this has to be double quotes

- name: Upload 3-device test results
uses: ./github/actions/upload-test-results
with:
PLATFORM: ${{ env.PLATFORM }}
UPLOAD_IDENTIFIER: devices-3-test-run

- name: Generate and publish test report
uses: ./github/actions/generate-publish-test-report
Expand All @@ -197,12 +248,6 @@ jobs:
GITHUB_RUN_NUMBER: ${{ github.run_number }}
GITHUB_RUN_ATTEMPT: ${{ github.run_attempt }}

- name: Upload results of this run
uses: ./github/actions/upload-test-results
with:
PLATFORM: ${{ env.PLATFORM }}
UPLOAD_IDENTIFIER: 'devices-other-test-run'

- name: Upload csv of this whole run
uses: ./github/actions/upload-csv-test-results
if: always()
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/ios-regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ on:
- '1'
- '2'
- '3'
default: '3'
- '4' # 4 is the max for our self hosted runner at the moment
default: '4'

LOG_LEVEL:
description: 'Test logging verbosity (WARNING: anything other than minimal mode may crash GitHub Actions on large test runs)'
Expand Down Expand Up @@ -81,7 +82,7 @@ jobs:
_TESTING: 1 # Always hide webdriver logs (@appium/support/ flag)
PRINT_FAILED_TEST_LOGS: ${{ github.event.inputs.LOG_LEVEL != 'minimal' && '1' || '0' }} # Show stdout/stderr if test fails (@session-foundation/playwright-reporter/ flag)
PRINT_ONGOING_TEST_LOGS: ${{ github.event.inputs.LOG_LEVEL == 'verbose' && '1' || '0' }} # Show everything as it happens (@session-foundation/playwright-reporter/ flag)
PLAYWRIGHT_WORKERS_COUNT: 3 # for iOS, this is the max we can have on our self-hosted runner
PLAYWRIGHT_WORKERS_COUNT: ${{ github.event.inputs.PLAYWRIGHT_WORKERS_COUNT }}
SDK_MANAGER_FULL_PATH: '<just_not_empty>'
AVD_MANAGER_FULL_PATH: '<just_not_empty>'
ANDROID_SYSTEM_IMAGE: '<just_not_empty>'
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.15.0
20.18.2
Loading
Loading