From 810a152f584f5891fd45eb76b7bb357d907ef1e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Schabrocker?= Date: Tue, 20 Jun 2017 10:00:16 +0200 Subject: [PATCH 01/11] add billingMethod to step.sh --- step.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/step.sh b/step.sh index aaa3adb..c2cdc0d 100755 --- a/step.sh +++ b/step.sh @@ -186,6 +186,7 @@ function device_farm_run { # Start run local run_params=(--project-arn="$device_farm_project") + run_params+=(--configuration="$billingMethod") run_params+=(--device-pool-arn="$device_pool") run_params+=(--app-arn="$app_arn") run_params+=(--test="{\"type\": \"${test_type}\",\"testPackageArn\": \"${test_package_arn}\",\"parameters\": {\"TestEnvVar\": \"foo\"}}") From cf9bce2cecf121674c127143a26f03b8072794a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Schabrocker?= Date: Tue, 20 Jun 2017 10:23:19 +0200 Subject: [PATCH 02/11] add billingMethod to step.yml --- step.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/step.yml b/step.yml index 6c70a90..4d474ad 100644 --- a/step.yml +++ b/step.yml @@ -52,6 +52,12 @@ inputs: summary: "" description: "Project ARNs can be obtained using the AWS CLI 'devicefarm list-projects' command." is_required: true + - billingMethod: "" + opts: + title: "billingMethod" + summary: "" + description: "If not defined, then METERED billing method will be used." + is_required: false - test_package_name: "" opts: title: "Test Package Filename" From 4097dbec92308732be393bbc215a1333df9f481d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Schabrocker?= Date: Tue, 20 Jun 2017 11:16:37 +0200 Subject: [PATCH 03/11] complete bilingMethod to step.sh --- step.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/step.sh b/step.sh index c2cdc0d..075ae9a 100755 --- a/step.sh +++ b/step.sh @@ -283,6 +283,7 @@ else fi echo_details "* device_farm_project: $device_farm_project" echo_details "* test_package_name: $test_package_name" +echo_details "* billingMethod: $billingMethod" echo_details "* test_type: $test_type" echo_details "* platform: $platform" echo_details "* ipa_path: $ipa_path" @@ -310,6 +311,11 @@ if [[ "$aws_region" != "" ]] ; then export AWS_DEFAULT_REGION="${aws_region}" fi +if [[ "$billingMethod" != "" ]] ; then + echo_details "AWS region (${billingMethod}) specified!" + export AWS_DEFAULT_REGION="${billingMethod}" +fi + export AWS_ACCESS_KEY_ID="${access_key_id}" export AWS_SECRET_ACCESS_KEY="${secret_access_key}" From 3266c827e45c0fcb3fb3db2b1f3ec51ef6c3b934 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Schabrocker?= Date: Tue, 20 Jun 2017 11:32:54 +0200 Subject: [PATCH 04/11] revert changes --- step.sh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/step.sh b/step.sh index 075ae9a..aaa3adb 100755 --- a/step.sh +++ b/step.sh @@ -186,7 +186,6 @@ function device_farm_run { # Start run local run_params=(--project-arn="$device_farm_project") - run_params+=(--configuration="$billingMethod") run_params+=(--device-pool-arn="$device_pool") run_params+=(--app-arn="$app_arn") run_params+=(--test="{\"type\": \"${test_type}\",\"testPackageArn\": \"${test_package_arn}\",\"parameters\": {\"TestEnvVar\": \"foo\"}}") @@ -283,7 +282,6 @@ else fi echo_details "* device_farm_project: $device_farm_project" echo_details "* test_package_name: $test_package_name" -echo_details "* billingMethod: $billingMethod" echo_details "* test_type: $test_type" echo_details "* platform: $platform" echo_details "* ipa_path: $ipa_path" @@ -311,11 +309,6 @@ if [[ "$aws_region" != "" ]] ; then export AWS_DEFAULT_REGION="${aws_region}" fi -if [[ "$billingMethod" != "" ]] ; then - echo_details "AWS region (${billingMethod}) specified!" - export AWS_DEFAULT_REGION="${billingMethod}" -fi - export AWS_ACCESS_KEY_ID="${access_key_id}" export AWS_SECRET_ACCESS_KEY="${secret_access_key}" From 4c240c7c021fb13f1a9c9bcab330368b13c7a835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Schabrocker?= Date: Tue, 20 Jun 2017 11:33:46 +0200 Subject: [PATCH 05/11] revert changes --- step.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/step.yml b/step.yml index 4d474ad..6c70a90 100644 --- a/step.yml +++ b/step.yml @@ -52,12 +52,6 @@ inputs: summary: "" description: "Project ARNs can be obtained using the AWS CLI 'devicefarm list-projects' command." is_required: true - - billingMethod: "" - opts: - title: "billingMethod" - summary: "" - description: "If not defined, then METERED billing method will be used." - is_required: false - test_package_name: "" opts: title: "Test Package Filename" From cd55849a8e39e2afa16353c835d71f56fce5b7ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Schabrocker?= Date: Tue, 20 Jun 2017 12:52:04 +0200 Subject: [PATCH 06/11] add billingMethod --- step.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/step.yml b/step.yml index 6c70a90..7b2a78c 100644 --- a/step.yml +++ b/step.yml @@ -52,6 +52,12 @@ inputs: summary: "" description: "Project ARNs can be obtained using the AWS CLI 'devicefarm list-projects' command." is_required: true + - billingMethod: "" + opts: + title: "Billing Method" + summary: "" + description: "use METERED or UNMETERED" + is_required: no - test_package_name: "" opts: title: "Test Package Filename" From 48560c8392ef9d57e3fe174ec0f0cfc630c75c1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Schabrocker?= Date: Tue, 20 Jun 2017 12:55:20 +0200 Subject: [PATCH 07/11] add billingMethod --- step.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/step.sh b/step.sh index aaa3adb..c7cfc60 100755 --- a/step.sh +++ b/step.sh @@ -187,6 +187,7 @@ function device_farm_run { # Start run local run_params=(--project-arn="$device_farm_project") run_params+=(--device-pool-arn="$device_pool") + run_params+=(--configuration="{\"billingMethod\": \"${billing_method}\"}") run_params+=(--app-arn="$app_arn") run_params+=(--test="{\"type\": \"${test_type}\",\"testPackageArn\": \"${test_package_arn}\",\"parameters\": {\"TestEnvVar\": \"foo\"}}") run_params+=(--output=json) @@ -283,6 +284,7 @@ fi echo_details "* device_farm_project: $device_farm_project" echo_details "* test_package_name: $test_package_name" echo_details "* test_type: $test_type" +echo_details "* billing_method: $billing_method" echo_details "* platform: $platform" echo_details "* ipa_path: $ipa_path" echo_details "* ios_pool: $ios_pool" From 55aa931e5cf6ba863add4a684d2d3888498eeb53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Schabrocker?= Date: Tue, 20 Jun 2017 15:52:51 +0200 Subject: [PATCH 08/11] update step.yml for billingMethod --- step.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/step.yml b/step.yml index 7b2a78c..d2e4236 100644 --- a/step.yml +++ b/step.yml @@ -57,7 +57,7 @@ inputs: title: "Billing Method" summary: "" description: "use METERED or UNMETERED" - is_required: no + is_required: false - test_package_name: "" opts: title: "Test Package Filename" From de65104db7d72ccf983c0a7c1c4846dcfe8583c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Schabrocker?= Date: Tue, 20 Jun 2017 15:56:35 +0200 Subject: [PATCH 09/11] update billing_method naming --- step.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/step.yml b/step.yml index d2e4236..ffe546a 100644 --- a/step.yml +++ b/step.yml @@ -52,7 +52,7 @@ inputs: summary: "" description: "Project ARNs can be obtained using the AWS CLI 'devicefarm list-projects' command." is_required: true - - billingMethod: "" + - billing_method: "" opts: title: "Billing Method" summary: "" From 5ff5971fc0324e961e2668f31fd6b048a7d15cff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Schabrocker?= Date: Tue, 20 Jun 2017 18:42:13 +0200 Subject: [PATCH 10/11] fix step.yml --- step.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/step.yml b/step.yml index ffe546a..a050cf1 100644 --- a/step.yml +++ b/step.yml @@ -52,11 +52,14 @@ inputs: summary: "" description: "Project ARNs can be obtained using the AWS CLI 'devicefarm list-projects' command." is_required: true - - billing_method: "" + - billing_method: "METERED" opts: title: "Billing Method" summary: "" - description: "use METERED or UNMETERED" + description: "This step specifies the billing methodfor your test run. Use `METERED` for free tier and pay-as-you-go billing, and `UNMETERED` to use pre-paid device slots.(https://docs.aws.amazon.com/devicefarm/latest/developerguide/how-to-purchase-device-slots.html)" + value_options: + - "METERED" + - "UNMETERED" is_required: false - test_package_name: "" opts: From 1cd4cfd153e4add3ae945c3f2fc251d0589d1ee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Schabrocker?= Date: Tue, 20 Jun 2017 18:45:05 +0200 Subject: [PATCH 11/11] verify, that expected billingMethod was passed --- step.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/step.sh b/step.sh index c7cfc60..52361c1 100755 --- a/step.sh +++ b/step.sh @@ -303,6 +303,9 @@ validate_required_input "device_farm_project" "${device_farm_project}" validate_required_input "test_package_name" "${test_package_name}" validate_required_input "test_type" "${test_type}" +options=("METERED" "UNMETERED") +validate_required_input_with_options "billing_method" "${billing_method}" "${options[@]}" + options=("ios" "android" "ios+android") validate_required_input_with_options "platform" "${platform}" "${options[@]}"