Search code examples
aws-device-farm

Device Farm test upload status sits in "INITIALIZED" status forever


I'm using AWS CLI to upload my android app and the tests.zip file to device farm. My test project type is Appium + Java + TestNG.

I'm able to upload the android app successfully, but while trying to upload the "tests.zip" the upload status shows INITIALIZED for ever, even though the upload is completed successfully.(using curl command)

I'm not able to proceed with my automated tests because of this issue. Any clue/suggestions would be really appreciated.

Below is the code snippet that I've been trying with so far and its output.

TEST_UPLOAD_RESPONSE=$(aws devicefarm create-upload --project-arn $DEVICE_FARM_PROJECT_ARN --name "zip-with-dependencies.zip" --type "APPIUM_JAVA_TESTNG_TEST_PACKAGE" --region "us-west-2" --output "json")
ANDROID_TEST_ARN=$(echo $TEST_UPLOAD_RESPONSE | jq '.upload.arn' | tr -d \")
TEST_PRESIGNED_URL=$(echo $TEST_UPLOAD_RESPONSE | jq '.upload.url' | tr -d \")
echo "Test upload url is :$TEST_PRESIGNED_URL"
echo "Test upload arn is :$ANDROID_TEST_ARN"

curl -T ./target/zip-with-dependencies.zip $APP_PRESIGNED_URL
sleep 5s
TEST_UPLOAD_STATUS=""
while [ "$TEST_UPLOAD_STATUS" != "SUCCEEDED" ]
do
  TEST_UPLOAD_STATUS=$(aws devicefarm get-upload --arn $ANDROID_TEST_ARN --query upload.status)
  TEST_UPLOAD_STATUS=$(echo $TEST_UPLOAD_STATUS | tr -d \")
  echo "Test upload status : $TEST_UPLOAD_STATUS"
done

App upload url is :https://prod-us-west-2-uploads.s3-us-west-2.amazonaws.com/arn%3Aaws%3Adevicefarm%3Aus-west-2%3A949397191675%3Aproject%3Acd2fdd09-4c62-42f4-8e27-bde987554d70/uploads/arn%3Aaws%3Adevicefarm%3Aus-west-2%3A949397191675%3Aupload%3Acd2fdd09-4c62-42f4-8e27-bde987554d70/22d28644-4c01-4b82-939c-8e39ee5a268e/zip-with-dependencies.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20190525T230634Z&X-Amz-SignedHeaders=host&X-Amz-Expires=86400&X-Amz-Credential=AKIAJSORV74ENYFBITRQ%2F20190525%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Signature=4ace7559023815966bbbd88af6357374bd511d021aeb9d222f9c08acdbb07ed5
App upload arn is :arn:aws:devicefarm:us-west-2:949397191675:upload:cd2fdd09-4c62-42f4-8e27-bde987554d70/22d28644-4c01-4b82-939c-8e39ee5a268e
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 41.2M 0 0 0 400k 0 536k 0:01:18 --:--:-- 0:01:18 536k
62 41.2M 0 0 62 25.6M 0 14.6M 0:00:02 0:00:01 0:00:01 14.6M
100 41.2M 0 0 100 41.2M 0 17.3M 0:00:02 0:00:02 --:--:-- 17.3M
Test upload status : INITIALIZED
Test upload status : INITIALIZED
Test upload status : INITIALIZED
Test upload status : INITIALIZED
Test upload status : INITIALIZED
Test upload status : INITIALIZED
Test upload status : INITIALIZED
Test upload status : INITIALIZED
.
.


Solution

  • Here is a document which shows the process you described

    https://docs.aws.amazon.com/devicefarm/latest/developerguide/how-to-create-test-run.html#how-to-create-test-run-cli-step4

    When you have the chance can you let me know if all these steps were followed?

    The description suggests to me that the wrong upload url was used or that the upload failed during the curl command.

    Please provide full output of the commands in the document and I should be able to help more.

    Hth

    -James