11#! /bin/bash
22project_arn=$DEVICEFARM_PROJECT_ARN
33max_devices=$NUMBER_OF_DEVICES_TO_TEST
4- test_spec_arn=$DEVICEFARM_TEST_SPEC_ARN
5- module_path=$1
6- # Extract everything after the last "/" if it exists, otherwise use the full value
7- module_name=${1##*/ }
8-
4+ module_name=$1
95file_name=" $module_name -debug-androidTest.apk"
10- full_path=" $module_path /build/outputs/apk/androidTest/debug/$file_name "
6+ full_path=" $module_name /build/outputs/apk/androidTest/debug/$file_name "
117
128if [[ -z " ${project_arn} " ]]; then
139 echo " DEVICEFARM_PROJECT_ARN environment variable not set."
@@ -115,19 +111,19 @@ stopDuplicates
115111# Schedule the test run in device farm
116112echo " Scheduling test run"
117113run_arn=` aws devicefarm schedule-run --project-arn=$project_arn \
118- --app-arn=" $app_package_upload_arn " \
119- --device-selection-configuration=' {
120- "filters": [
121- {"attribute": "ARN", "operator":"IN", "values":["' $minDevice ' ", "' $middleDevice ' ", "' $latestDevice ' "]}
122- ],
123- "maxDevices": ' $max_devices '
124- }' \
125- --name=" $file_name -$CODEBUILD_SOURCE_VERSION " \
126- --test=" testSpecArn= $test_spec_arn , type=INSTRUMENTATION,testPackageArn=$test_package_upload_arn " \
127- --execution-configuration=" jobTimeoutMinutes=30,videoCapture=false" \
128- --query=" run.arn" \
129- --output=text \
130- --region=" us-west-2" `
114+ --app-arn=" $app_package_upload_arn " \
115+ --device-selection-configuration=' {
116+ "filters": [
117+ {"attribute": "ARN", "operator":"IN", "values":["' $minDevice ' ", "' $middleDevice ' ", "' $latestDevice ' "]}
118+ ],
119+ "maxDevices": ' $max_devices '
120+ }' \
121+ --name=" $file_name -$CODEBUILD_SOURCE_VERSION " \
122+ --test=" type=INSTRUMENTATION,testPackageArn=$test_package_upload_arn " \
123+ --execution-configuration=" jobTimeoutMinutes=30,videoCapture=false" \
124+ --query=" run.arn" \
125+ --output=text \
126+ --region=" us-west-2" `
131127
132128status=' NONE'
133129result=' NONE'
@@ -145,15 +141,11 @@ while true; do
145141done
146142echo " Status = $status Result = $result "
147143
148- ./scripts/python/generate_df_testrun_report.py \
149- -r " $run_arn " \
150- -m " $module_name " \
151- -o " build/allTests/$module_name /"
152-
144+ ./scripts/generate_df_testrun_report --run_arn=" $run_arn " --module_name=" $module_name " --pr=" $CODEBUILD_SOURCE_VERSION " --output_path=" build/allTests/$module_name /"
153145# If the result is PASSED, then exit with a return code 0
154146if [ " $result " = " PASSED" ]
155147then
156148 exit 0
157149fi
158150# Otherwise, exit with a non-zero.
159- exit 1
151+ exit 1
0 commit comments