Skip to content
This repository has been archived by the owner on Apr 13, 2022. It is now read-only.

add opportunity for metered/unmetered BillingMethod #26

Merged
merged 11 commits into from
Jun 20, 2017
5 changes: 5 additions & 0 deletions step.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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"
Copy link
Contributor

@fadookie fadookie Jun 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also around line 306 please add the following code to validate the expected option was passed:

options=("METERED" "UNMETERED")
validate_required_input_with_options "billing_method" "${billing_method}" "${options[@]}"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

echo_details "* platform: $platform"
echo_details "* ipa_path: $ipa_path"
echo_details "* ios_pool: $ios_pool"
Expand All @@ -301,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[@]}"

Expand Down
9 changes: 9 additions & 0 deletions step.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ inputs:
summary: ""
description: "Project ARNs can be obtained using the AWS CLI 'devicefarm list-projects' command."
is_required: true
- billing_method: "METERED"
opts:
title: "Billing Method"
summary: ""
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:
title: "Test Package Filename"
Expand Down