Skip to content

Commit 4ff1e27

Browse files
authored
Migrate mobile tests to BrowserStack (#28)
1 parent 434cb91 commit 4ff1e27

File tree

16 files changed

+428
-310
lines changed

16 files changed

+428
-310
lines changed

.github/workflows/android-appcenter.yml renamed to .github/workflows/android-browserstack.yml

Lines changed: 33 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
name: Android AppCenter Tests
1+
name: Android BrowserStack Tests
22

33
on:
44
workflow_dispatch:
55
push:
66
branches: [ main ]
77
paths:
88
- 'binding/android/FalconTestApp/**'
9-
- '.github/workflows/android-appcenter.yml'
9+
- '.github/workflows/android-browserstack.yml'
1010
- 'resources/audio_samples/**'
1111
pull_request:
1212
branches: [ main, 'v[0-9]+.[0-9]+' ]
1313
paths:
1414
- 'binding/android/FalconTestApp/**'
15-
- '.github/workflows/android-appcenter.yml'
15+
- '.github/workflows/android-browserstack.yml'
1616
- 'resources/audio_samples/**'
1717

1818
defaults:
@@ -21,19 +21,18 @@ defaults:
2121

2222
jobs:
2323
build:
24-
name: Run Android Tests on AppCenter
24+
name: Run Android Tests on BrowserStack
2525
runs-on: ubuntu-latest
2626

2727
steps:
2828
- uses: actions/checkout@v3
2929

30-
- name: Set up Node.js LTS
31-
uses: actions/setup-node@v3
30+
- name: Installing Python
31+
uses: actions/setup-python@v5
3232
with:
33-
node-version: lts/*
34-
35-
- name: Install AppCenter CLI
36-
run: npm install -g appcenter-cli
33+
python-version: '3.10'
34+
- run:
35+
pip3 install requests
3736

3837
- name: set up JDK 11
3938
uses: actions/setup-java@v3
@@ -66,30 +65,29 @@ jobs:
6665
- name: Build androidTest
6766
run: ./gradlew assembleDebugAndroidTest
6867

69-
- name: Run tests on AppCenter
70-
run: appcenter test run espresso
71-
--token ${{secrets.APPCENTERAPITOKEN}}
72-
--app "Picovoice/Falcon-Android"
73-
--devices "Picovoice/android-min-max"
74-
--app-path falcon-test-app/build/outputs/apk/debug/falcon-test-app-debug.apk
75-
--test-series "falcon-android"
76-
--locale "en_US"
77-
--build-dir falcon-test-app/build/outputs/apk/androidTest/debug
68+
- name: Run tests on BrowserStack
69+
run: python3 ../../../script/automation/browserstack.py
70+
--type espresso
71+
--username "${{secrets.BROWSERSTACK_USERNAME}}"
72+
--access_key "${{secrets.BROWSERSTACK_ACCESS_KEY}}"
73+
--project_name "Falcon-Android"
74+
--devices "android-min-max"
75+
--app_path "falcon-test-app/build/outputs/apk/debug/falcon-test-app-debug.apk"
76+
--test_path "falcon-test-app/build/outputs/apk/androidTest/debug/falcon-test-app-debug-androidTest.apk"
7877

7978
build-integ:
80-
name: Run Android Integration Tests on AppCenter
79+
name: Run Android Integration Tests on BrowserStack
8180
runs-on: ubuntu-latest
8281

8382
steps:
8483
- uses: actions/checkout@v3
8584

86-
- name: Set up Node.js LTS
87-
uses: actions/setup-node@v3
85+
- name: Installing Python
86+
uses: actions/setup-python@v5
8887
with:
89-
node-version: lts/*
90-
91-
- name: Install AppCenter CLI
92-
run: npm install -g appcenter-cli
88+
python-version: '3.10'
89+
- run:
90+
pip3 install requests
9391

9492
- name: set up JDK 11
9593
uses: actions/setup-java@v3
@@ -122,12 +120,12 @@ jobs:
122120
- name: Build androidTest
123121
run: ./gradlew assembleReleaseAndroidTest -DtestBuildType=integ
124122

125-
- name: Run tests on AppCenter
126-
run: appcenter test run espresso
127-
--token ${{secrets.APPCENTERAPITOKEN}}
128-
--app "Picovoice/Falcon-Android"
129-
--devices "Picovoice/android-min-max"
130-
--app-path falcon-test-app/build/outputs/apk/release/falcon-test-app-release.apk
131-
--test-series "falcon-android"
132-
--locale "en_US"
133-
--build-dir falcon-test-app/build/outputs/apk/androidTest/release
123+
- name: Run tests on BrowserStack
124+
run: python3 ../../../script/automation/browserstack.py
125+
--type espresso
126+
--username "${{secrets.BROWSERSTACK_USERNAME}}"
127+
--access_key "${{secrets.BROWSERSTACK_ACCESS_KEY}}"
128+
--project_name "Falcon-Android-Integration"
129+
--devices "android-min-max"
130+
--app_path "falcon-test-app/build/outputs/apk/release/falcon-test-app-release.apk"
131+
--test_path "falcon-test-app/build/outputs/apk/androidTest/release/falcon-test-app-release-androidTest.apk"

.github/workflows/android-perf.yml

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,26 @@ defaults:
2121

2222
jobs:
2323
build:
24-
name: Run Android Speed Tests on AppCenter
24+
name: Run Android Speed Tests on BrowserStack
2525
runs-on: ubuntu-latest
2626

2727
strategy:
2828
matrix:
29-
device: [single-android, 32bit-android]
29+
device: [ android-perf ]
3030
include:
31-
- device: single-android
31+
- device: android-perf
3232
initPerformanceThresholdSec: 1.0
33-
procPerformanceThresholdSec: 1.0
34-
- device: 32bit-android
35-
initPerformanceThresholdSec: 1.0
36-
procPerformanceThresholdSec: 7.0
33+
procPerformanceThresholdSec: 2.0
3734

3835
steps:
3936
- uses: actions/checkout@v3
4037

41-
- name: Setup Node.js environment
42-
uses: actions/setup-node@v3
43-
44-
- name: Install AppCenter CLI
45-
run: npm install -g appcenter-cli
38+
- name: Installing Python
39+
uses: actions/setup-python@v5
40+
with:
41+
python-version: '3.10'
42+
- run:
43+
pip3 install requests
4644

4745
- name: set up JDK 11
4846
uses: actions/setup-java@v3
@@ -84,12 +82,12 @@ jobs:
8482
- name: Build androidTest
8583
run: ./gradlew assembleDebugAndroidTest -DtestBuildType=perf
8684

87-
- name: Run tests on AppCenter
88-
run: appcenter test run espresso
89-
--token ${{secrets.APPCENTERAPITOKEN}}
90-
--app "Picovoice/Falcon-Android"
91-
--devices "Picovoice/${{ matrix.device }}"
92-
--app-path falcon-test-app/build/outputs/apk/debug/falcon-test-app-debug.apk
93-
--test-series "falcon-android"
94-
--locale "en_US"
95-
--build-dir falcon-test-app/build/outputs/apk/androidTest/debug
85+
- name: Run tests on BrowserStack
86+
run: python3 ../../../script/automation/browserstack.py
87+
--type espresso
88+
--username "${{secrets.BROWSERSTACK_USERNAME}}"
89+
--access_key "${{secrets.BROWSERSTACK_ACCESS_KEY}}"
90+
--project_name "Falcon-Android-Performance"
91+
--devices "${{ matrix.device }}"
92+
--app_path "falcon-test-app/build/outputs/apk/debug/falcon-test-app-debug.apk"
93+
--test_path "falcon-test-app/build/outputs/apk/androidTest/debug/falcon-test-app-debug-androidTest.apk"

.github/workflows/ios-appcenter.yml

Lines changed: 0 additions & 74 deletions
This file was deleted.
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: iOS BrowserStack Tests
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ main ]
7+
paths:
8+
- '.github/workflows/ios-browserstack.yml'
9+
- 'binding/ios/FalconAppTest/**'
10+
- 'resources/audio_samples/**'
11+
pull_request:
12+
branches: [ main, 'v[0-9]+.[0-9]+' ]
13+
paths:
14+
- '.github/workflows/ios-browserstack.yml'
15+
- 'binding/ios/FalconAppTest/**'
16+
- 'resources/audio_samples/**'
17+
18+
defaults:
19+
run:
20+
working-directory: binding/ios/FalconAppTest
21+
22+
jobs:
23+
build:
24+
name: Run iOS Tests on BrowserStack
25+
runs-on: macos-latest
26+
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v3
30+
31+
- name: Installing Python
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: '3.10'
35+
- run:
36+
pip3 install requests
37+
38+
- name: Install Cocoapods
39+
run: gem install cocoapods
40+
41+
- name: Make build dir
42+
run: mkdir ddp
43+
44+
- name: Copy test_resources
45+
run: ./copy_test_resources.sh
46+
47+
- name: Run Cocoapods
48+
run: pod install
49+
50+
- name: Inject AccessKey
51+
run: sed -i '.bak' 's:{TESTING_ACCESS_KEY_HERE}:${{secrets.PV_VALID_ACCESS_KEY}}:'
52+
FalconAppTestUITests/FalconAppTestUITests.swift
53+
54+
- name: XCode Build
55+
run: xcrun xcodebuild build-for-testing
56+
-configuration Debug
57+
-workspace FalconAppTest.xcworkspace
58+
-sdk iphoneos
59+
-scheme FalconAppTest
60+
-derivedDataPath ddp
61+
CODE_SIGNING_ALLOWED=NO
62+
63+
- name: Generating ipa
64+
run: cd ddp/Build/Products/Debug-iphoneos/ &&
65+
mkdir Payload &&
66+
cp -r FalconAppTest.app Payload &&
67+
zip --symlinks -r FalconAppTest.ipa Payload &&
68+
rm -r Payload
69+
70+
- name: Zipping Tests
71+
run: cd ddp/Build/Products/Debug-iphoneos/ &&
72+
zip --symlinks -r FalconAppTestUITests.zip FalconAppTestUITests-Runner.app
73+
74+
- name: Run tests on BrowserStack
75+
run: python3 ../../../script/automation/browserstack.py
76+
--type xcuitest
77+
--username "${{secrets.BROWSERSTACK_USERNAME}}"
78+
--access_key "${{secrets.BROWSERSTACK_ACCESS_KEY}}"
79+
--project_name "Falcon-iOS"
80+
--devices "ios-min-max"
81+
--app_path "ddp/Build/Products/Debug-iphoneos/FalconAppTest.ipa"
82+
--test_path "ddp/Build/Products/Debug-iphoneos/FalconAppTestUITests.zip"

.github/workflows/ios-demos.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ jobs:
3333
- name: Install Cocoapods
3434
run: gem install cocoapods
3535

36-
- name: Install AppCenter CLI
37-
run: npm install -g appcenter-cli
38-
3936
- name: Make build dir
4037
run: mkdir ddp
4138

0 commit comments

Comments
 (0)