Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add device farm ci job testing on android 8 #589

Merged
merged 1 commit into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ jobs:
../../../../android/gradlew assembledebug
../../../../android/gradlew assembleAndroidTest
cd ~
- name: Python Script
- name: Device Farm Tests Highly Available
run: |
echo "Attempting to run python script"
python3 -m pip install requests
Expand All @@ -414,7 +414,19 @@ jobs:
--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
run: |
echo "Attempting to run python script"
python3 -m pip install requests
python3 ./utils/run_android_ci.py \
--region ${{ env.AWS_DEVICE_FARM_REGION }} \
--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/Android8" --query "SecretString" | cut -f5 -d\" | cut -f1 -d'\') \
--device_pool android_8

# check that docs can still build
check-docs:
Expand Down
6 changes: 4 additions & 2 deletions utils/run_android_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,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 + '/sdk/tests/android/testapp/build/outputs/apk/debug/testapp-debug.apk'
Expand All @@ -30,6 +31,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

print("Beginning Android Device Farm Setup\n")

Expand All @@ -43,7 +45,7 @@ def main():


# Upload the build apk file 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)

# Setup upload to Device Farm project
Expand All @@ -70,7 +72,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'
create_upload_response = client.create_upload(
projectArn=project_arn,
name=upload_test_file_name,
Expand Down
Loading