Skip to content

Commit

Permalink
devices
Browse files Browse the repository at this point in the history
  • Loading branch information
albho committed Nov 14, 2024
1 parent 1012d7a commit 777ae19
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 29 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/android-browserstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ jobs:
--type espresso
--username "${{secrets.BROWSERSTACK_USERNAME}}"
--access_key "${{secrets.BROWSERSTACK_ACCESS_KEY}}"
--project_name "Cobra-Migration-Test-Android-Build"
--project_name "Cobra-Android"
--devices "android-min-max"
--app_path "cobra-test-app/build/outputs/apk/debug/cobra-test-app-debug.apk"
--test_path "cobra-test-app/build/outputs/apk/androidTest/debug/cobra-test-app-debug-androidTest.apk"

Expand Down Expand Up @@ -120,6 +121,7 @@ jobs:
--type espresso
--username "${{secrets.BROWSERSTACK_USERNAME}}"
--access_key "${{secrets.BROWSERSTACK_ACCESS_KEY}}"
--project_name "Cobra-Migration-Test-Android-Build-Integ"
--project_name "Cobra-Android-Integration"
--devices "android-min-max"
--app_path "cobra-test-app/build/outputs/apk/release/cobra-test-app-release.apk"
--test_path "cobra-test-app/build/outputs/apk/androidTest/release/cobra-test-app-release-androidTest.apk"
--test_path "cobra-test-app/build/outputs/apk/androidTest/release/cobra-test-app-release-androidTest.apk"
11 changes: 5 additions & 6 deletions .github/workflows/android-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@ jobs:

strategy:
matrix:
device: [single-android, 32bit-android]
device: [ android-perf ]
include:
- device: single-android
- device: android-perf
performanceThresholdSec: 0.005
- device: 32bit-android
performanceThresholdSec: 0.015

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -83,6 +81,7 @@ jobs:
--type espresso
--username "${{secrets.BROWSERSTACK_USERNAME}}"
--access_key "${{secrets.BROWSERSTACK_ACCESS_KEY}}"
--project_name "Cobra-Migration-Test-Android-Perf"
--project_name "Cobra-Android-Performance"
--devices "${{ matrix.device }}"
--app_path "cobra-test-app/build/outputs/apk/debug/cobra-test-app-debug.apk"
--test_path "cobra-test-app/build/outputs/apk/androidTest/debug/cobra-test-app-debug-androidTest.apk"
--test_path "cobra-test-app/build/outputs/apk/androidTest/debug/cobra-test-app-debug-androidTest.apk"
5 changes: 3 additions & 2 deletions .github/workflows/ios-browserstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ jobs:
--type xcuitest
--username "${{secrets.BROWSERSTACK_USERNAME}}"
--access_key "${{secrets.BROWSERSTACK_ACCESS_KEY}}"
--project_name "Cobra-Migration-Test-iOS"
--project_name "Cobra-iOS"
--devices "ios-min-max"
--app_path "ddp/Build/Products/Debug-iphoneos/CobraAppTest.ipa"
--test_path "ddp/Build/Products/Debug-iphoneos/CobraAppTestUITests.zip"
--test_path "ddp/Build/Products/Debug-iphoneos/CobraAppTestUITests.zip"
3 changes: 2 additions & 1 deletion .github/workflows/ios-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ jobs:
--type xcuitest
--username "${{secrets.BROWSERSTACK_USERNAME}}"
--access_key "${{secrets.BROWSERSTACK_ACCESS_KEY}}"
--project_name "Cobra-Migration-Test-iOS-Perf"
--project_name "Cobra-iOS-Performance"
--devices "${{ matrix.device }}"
--app_path "ddp/Build/Products/Debug-iphoneos/CobraAppTest.ipa"
--test_path "ddp/Build/Products/Debug-iphoneos/PerformanceTest.zip"
38 changes: 21 additions & 17 deletions script/automation/browserstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,24 @@
BUILD_URI = 'https://api-cloud.browserstack.com/app-automate/{}/v2/build'
STATUS_URI = 'https://api-cloud.browserstack.com/app-automate/{}/v2/builds/{}'

ESPRESSO_DEVICES = [
'Google Pixel 6 Pro-12.0'
]

XCUITEST_DEVICES = [
'iPhone 12 Pro-17'
]

def get_devices(type: str):
if type == 'espresso':
return ESPRESSO_DEVICES
elif type == 'xcuitest':
return XCUITEST_DEVICES
else:
return []
devices_dict = {
'android-min-max': [
'Galaxy S8-7',
'Galaxy S21-11',
'Pixel 9-15'
],
'android-perf': [
'Pixel 6 Pro-15'
],
'ios-min-max': [
'iPhone 7-10',
'iPhone 12 Pro-17',
'iPhone 16-18.1'
],
'ios-perf': [
'Apple iPhone 12-17',
]
}

def main(args: argparse.Namespace) -> None:
app_files = {
Expand Down Expand Up @@ -60,7 +63,7 @@ def main(args: argparse.Namespace) -> None:
'app': app_response_json['app_url'],
'testSuite': test_response_json['test_suite_url'],
'project': args.project_name,
'devices': get_devices(args.type)
'devices': devices_dict[args.devices]
}
build_response = requests.post(
BUILD_URI.format(args.type),
Expand Down Expand Up @@ -107,8 +110,9 @@ def main(args: argparse.Namespace) -> None:
parser.add_argument('--access_key', required=True)

parser.add_argument('--project_name', required=True)
parser.add_argument('--devices', choices=devices_dict.keys(), required=True)
parser.add_argument('--app_path', required=True)
parser.add_argument('--test_path', required=True)
args = parser.parse_args()

main(args)
main(args)

0 comments on commit 777ae19

Please sign in to comment.