Skip to content

Commit

Permalink
add additional device pool to test (#793)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbSteveK authored Jun 14, 2024
1 parent 4069614 commit 44cc86f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,24 @@ jobs:
cd src/test/android/testapp
../../../../gradlew assembledebug
../../../../gradlew assembleAndroidTest
- name: Device Farm Tests
- name: Device Farm Tests Highly Available
run: |
echo "Running Device Farm Python Script"
python3 ./.github/workflows/run_android_ci.py \
--run_id ${{ github.run_id }} \
--run_attempt ${{ github.run_attempt }} \
--project_arn $(aws secretsmanager get-secret-value --region us-east-1 --secret-id "ci/DeviceFarm/ProjectArn" --query "SecretString" | cut -f5 -d\" | cut -f1 -d'\') \
--device_pool_arn $(aws secretsmanager get-secret-value --region us-east-1 --secret-id "ci/DeviceFarm/DevicePoolArn" --query "SecretString" | cut -f5 -d\" | cut -f1 -d'\')
--device_pool_arn $(aws secretsmanager get-secret-value --region us-east-1 --secret-id "ci/DeviceFarm/DevicePoolArn" --query "SecretString" | cut -f5 -d\" | cut -f1 -d'\') \
--device_pool highly_available
- name: Device Farm Tests Android 8.0.0
run: |
echo "Running Device Farm Python Script"
python3 ./.github/workflows/run_android_ci.py \
--run_id ${{ github.run_id }} \
--run_attempt ${{ github.run_attempt }} \
--project_arn $(aws secretsmanager get-secret-value --region us-east-1 --secret-id "ci/DeviceFarm/ProjectArn" --query "SecretString" | cut -f5 -d\" | cut -f1 -d'\') \
--device_pool_arn $(aws secretsmanager get-secret-value --region us-east-1 --secret-id "ci/DeviceFarm/DevicePoolArnAndroid8" --query "SecretString" | cut -f5 -d\" | cut -f1 -d'\') \
--device_pool android_8
# check that docs can still build
check-docs:
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/run_android_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
parser.add_argument('--run_attempt', required=True, help="A unique number for each attempt of a particular workflow run in a repository")
parser.add_argument('--project_arn', required=True, help="Arn for the Device Farm Project the apk will be tested on")
parser.add_argument('--device_pool_arn', required=True, help="Arn for device pool of the Device Farm Project the apk will be tested on")
parser.add_argument('--device_pool', required=True, help="Which device pool is being used for this test")

current_working_directory = os.getcwd()
build_file_location = current_working_directory + '/src/test/android/testapp/build/outputs/apk/debug/testapp-debug.apk'
Expand All @@ -24,6 +25,7 @@ def main():
run_attempt = args.run_attempt
project_arn = args.project_arn
device_pool_arn = args.device_pool_arn
device_pool = args.device_pool

region = os.getenv('AWS_DEVICE_FARM_REGION')

Expand All @@ -38,7 +40,7 @@ def main():
print("Boto3 client established")

# Upload the crt library shell app to Device Farm
upload_file_name = 'CI-' + run_id + '-' + run_attempt + '.apk'
upload_file_name = 'CI-' + run_id + '-' + run_attempt + '-' + device_pool + '.apk'
print('Upload file name: ' + upload_file_name)

# Prepare upload to Device Farm project
Expand All @@ -64,7 +66,7 @@ def main():
device_farm_upload_status = client.get_upload(arn=device_farm_upload_arn)

# Upload the instrumentation test package to Device Farm
upload_test_file_name = 'CI-' + run_id + '-' + run_attempt + 'tests.apk'
upload_test_file_name = 'CI-' + run_id + '-' + run_attempt + '-' + device_pool + 'tests.apk'
print('Upload file name: ' + upload_test_file_name)

# Prepare upload to Device Farm project
Expand All @@ -90,7 +92,7 @@ def main():
device_farm_upload_status = client.get_upload(arn=device_farm_instrumentation_upload_arn)

# Upload the test spec file to Device Farm
upload_spec_file_name = 'CI-' + run_id + '-' + run_attempt + 'test-spec.yml'
upload_spec_file_name = 'CI-' + run_id + '-' + run_attempt + '-' + device_pool + 'test-spec.yml'
print('Upload file name: ' + upload_spec_file_name)

# Prepare upload to Device Farm project
Expand Down

0 comments on commit 44cc86f

Please sign in to comment.