Device Farm测试上传状态永远处于“ INITIALIZED”状态

时间:2019-05-25 23:36:10

标签: aws-device-farm

我正在使用AWS CLI将我的android应用程序和tests.zip文件上传到设备场。我的测试项目类型是Appium + Java + TestNG。

我能够成功上传android应用,但是在尝试上传“ tests.zip”时,即使上传成功完成,上传状态也永远显示为INITIALIZED。(使用curl命令)

由于这个问题,我无法继续进行自动化测试。任何线索/建议将不胜感激。

下面是到目前为止我一直在尝试的代码片段及其输出。

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
  

应用上传网址为: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
  应用上传arn是:arn:aws:devicefarm:us-west-2:949397191675:upload:cd2fdd09-4c62-42f4-8e27-bde987554d70 / 22d28644-4c01-4b82-939c-8e39ee5a268e
    %总计%接收的%Xferd平均速度时间时间时间当前                                    Dload上传总花费左手速度
    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
  测试上传状态:INITIALIZED
  测试上传状态:INITIALIZED
  测试上传状态:INITIALIZED
  测试上传状态:INITIALIZED
  测试上传状态:INITIALIZED
  测试上传状态:INITIALIZED
  测试上传状态:INITIALIZED
  测试上传状态:INITIALIZED
  。
  。

1 个答案:

答案 0 :(得分:1)

此处是显示您所描述的过程的文档

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

如果有机会,您能否让我知道是否遵循了所有这些步骤?

该说明向我建议使用了错误的上载URL,或者在curl命令期间上载失败。

请提供文档中命令的完整输出,我应该能够提供更多帮助。

高度

-詹姆斯