Skip to content

Commit c071e0e

Browse files
authored
Migrate mobile testing to BrowserStack (#70)
1 parent bb99e2f commit c071e0e

File tree

17 files changed

+318
-190
lines changed

17 files changed

+318
-190
lines changed
Lines changed: 37 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
name: Android AppCenter Tests
1+
name: Android BrowserStack Tests
22

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

@@ -21,24 +21,23 @@ 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/*
33+
python-version: '3.10'
34+
- run:
35+
pip3 install requests
3436

35-
- name: Install AppCenter CLI
36-
run: npm install -g appcenter-cli
37-
38-
- name: set up JDK 11
37+
- name: set up JDK 17
3938
uses: actions/setup-java@v3
4039
with:
41-
java-version: '11'
40+
java-version: '17'
4241
distribution: 'temurin'
4342

4443
- name: Copy test_resources
@@ -63,35 +62,34 @@ jobs:
6362
- name: Build androidTest
6463
run: ./gradlew assembleAndroidTest
6564

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

7675
build-integ:
77-
name: Run Android Integration Tests on AppCenter
76+
name: Run Android Integration Tests on BrowserStack
7877
runs-on: ubuntu-latest
7978

8079
steps:
8180
- uses: actions/checkout@v3
8281

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

91-
- name: set up JDK 11
89+
- name: set up JDK 17
9290
uses: actions/setup-java@v3
9391
with:
94-
java-version: '11'
92+
java-version: '17'
9593
distribution: 'temurin'
9694

9795
- name: Copy test_resources
@@ -119,12 +117,12 @@ jobs:
119117
- name: Build androidTest
120118
run: ./gradlew assembleReleaseAndroidTest -DtestBuildType=integ
121119

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

.github/workflows/android-demos.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ jobs:
2525
steps:
2626
- uses: actions/checkout@v3
2727

28-
- name: set up JDK 11
28+
- name: set up JDK 17
2929
uses: actions/setup-java@v3
3030
with:
31-
java-version: '11'
31+
java-version: '17'
3232
distribution: 'temurin'
3333

3434
- name: Build

.github/workflows/android-perf.yml

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,33 +23,30 @@ defaults:
2323

2424
jobs:
2525
build:
26-
name: Run Android Speed Tests on AppCenter
26+
name: Run Android Speed Tests on BrowserStack
2727
runs-on: ubuntu-latest
2828

2929
strategy:
3030
matrix:
31-
device: [single-android, 32bit-android]
31+
device: [ android-perf ]
3232
include:
33-
- device: single-android
33+
- device: android-perf
3434
performanceThresholdSec: 0.4
35-
- device: 32bit-android
36-
performanceThresholdSec: 3.0
3735

3836
steps:
3937
- uses: actions/checkout@v3
4038

41-
- name: Set up Node.js LTS
42-
uses: actions/setup-node@v3
39+
- name: Installing Python
40+
uses: actions/setup-python@v5
4341
with:
44-
node-version: lts/*
42+
python-version: '3.10'
43+
- run:
44+
pip3 install requests
4545

46-
- name: Install AppCenter CLI
47-
run: npm install -g appcenter-cli
48-
49-
- name: set up JDK 11
46+
- name: set up JDK 17
5047
uses: actions/setup-java@v3
5148
with:
52-
java-version: '11'
49+
java-version: '17'
5350
distribution: 'temurin'
5451

5552
- name: Copy test_resources
@@ -83,13 +80,13 @@ jobs:
8380
- name: Build androidTest
8481
run: ./gradlew assembleAndroidTest -DtestBuildType=perf
8582

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

.github/workflows/ios-appcenter.yml

Lines changed: 0 additions & 68 deletions
This file was deleted.
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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/KoalaAppTest/**'
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/KoalaAppTest/**'
16+
- 'resources/audio_samples/**'
17+
18+
defaults:
19+
run:
20+
working-directory: binding/ios/KoalaAppTest
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: Run Cocoapods
45+
run: pod install
46+
47+
- name: Inject AppID
48+
run: sed -i '.bak' 's:{TESTING_ACCESS_KEY_HERE}:${{secrets.PV_VALID_ACCESS_KEY}}:'
49+
KoalaAppTestUITests/KoalaAppTestUITests.swift
50+
51+
- name: XCode Build
52+
run: xcrun xcodebuild build-for-testing
53+
-configuration Debug
54+
-workspace KoalaAppTest.xcworkspace
55+
-sdk iphoneos
56+
-scheme KoalaAppTest
57+
-derivedDataPath ddp
58+
CODE_SIGNING_ALLOWED=NO
59+
60+
- name: Generating ipa
61+
run: cd ddp/Build/Products/Debug-iphoneos/ &&
62+
mkdir Payload &&
63+
cp -r KoalaAppTest.app Payload &&
64+
zip --symlinks -r KoalaAppTest.ipa Payload &&
65+
rm -r Payload
66+
67+
- name: Zipping Tests
68+
run: cd ddp/Build/Products/Debug-iphoneos/ &&
69+
zip --symlinks -r KoalaAppTestUITests.zip KoalaAppTestUITests-Runner.app
70+
71+
- name: Run tests on BrowserStack
72+
run: python3 ../../../script/automation/browserstack.py
73+
--type xcuitest
74+
--username "${{secrets.BROWSERSTACK_USERNAME}}"
75+
--access_key "${{secrets.BROWSERSTACK_ACCESS_KEY}}"
76+
--project_name "Koala-iOS"
77+
--devices "ios-min-max"
78+
--app_path "ddp/Build/Products/Debug-iphoneos/KoalaAppTest.ipa"
79+
--test_path "ddp/Build/Products/Debug-iphoneos/KoalaAppTestUITests.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)