Skip to content

Commit

Permalink
revert intentional failures, try new handling of parallel threads lim…
Browse files Browse the repository at this point in the history
…it reached
  • Loading branch information
albho committed Nov 14, 2024
1 parent 818e2d8 commit 000d365
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/android-browserstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
run: ./copy_test_resources.sh

- name: Inject AccessKey
run: echo pvTestingAccessKey="123abc" >> local.properties
run: echo pvTestingAccessKey="${{secrets.PV_VALID_ACCESS_KEY}}" >> local.properties

- name: Inject Android keystore variables
run: |
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
run: ./copy_test_resources.sh

- name: Inject AccessKey
run: echo pvTestingAccessKey="123abc" >> local.properties
run: echo pvTestingAccessKey="${{secrets.PV_VALID_ACCESS_KEY}}" >> local.properties

- name: Inject Android keystore variables
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/android-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
device: [ android-perf ]
include:
- device: android-perf
performanceThresholdSec: 0 # 0.005
performanceThresholdSec: 0.005

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ios-browserstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
run: mkdir ddp

- name: Inject AccessKey
run: sed -i '.bak' 's:{TESTING_ACCESS_KEY_HERE}:123abc:'
run: sed -i '.bak' 's:{TESTING_ACCESS_KEY_HERE}:${{secrets.PV_VALID_ACCESS_KEY}}:'
CobraAppTestUITests/CobraAppTestUITests.swift

- name: XCode Build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ios-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
device: [ ios-perf ]
include:
- device: ios-perf
performanceThresholdSec: 0 # 0.001
performanceThresholdSec: 0.001

steps:
- name: Checkout
Expand Down
27 changes: 8 additions & 19 deletions script/automation/browserstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,28 +66,17 @@ def main(args: argparse.Namespace) -> None:
'devices': devices_dict[args.devices]
}

while True:
build_response = requests.post(
BUILD_URI.format(args.type),
headers=build_headers,
json=build_data,
auth=(args.username, args.access_key)
)
if (build_response is not None and 'message' in build_response.json() and '[BROWSERSTACK_ALL_PARALLELS_IN_USE]'
in build_response.json()['message']):
print('Parallel threads limit reached. Waiting...', flush=True)
time.sleep(60)
else:
break

if build_response is None:
print('Build Failed')
exit(1)
build_response = requests.post(
BUILD_URI.format(args.type),
headers=build_headers,
json=build_data,
auth=(args.username, args.access_key)
)

build_response_json = build_response.json()

if not build_response.ok:
print('Build Failed', build_response.json())
if not build_response.ok and ('message' in build_response_json and '[BROWSERSTACK_ALL_PARALLELS_IN_USE]' not in build_response_json['message']):
print('Build Failed', build_response_json)
exit(1)

if build_response_json['message'] != 'Success':
Expand Down

0 comments on commit 000d365

Please sign in to comment.