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
2 changes: 2 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 Down
6 changes: 6 additions & 0 deletions step.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ inputs:
summary: ""
description: "Project ARNs can be obtained using the AWS CLI 'devicefarm list-projects' command."
is_required: true
- billing_method: ""
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can change this to billingMethod: "METERED" to set the default to metered as this is probably what most people will be using.

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

opts:
title: "Billing Method"
summary: ""
description: "use METERED or UNMETERED"
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.

Can you make this a little more descriptive? How about

"Specifies the billing method for a test run. Use `METERED` for free tier and pay-as-you-go billing, and `UNMETERED` to use pre-paid device slots. See [How to purchase device slots](https://docs.aws.amazon.com/devicefarm/latest/developerguide/how-to-purchase-device-slots.html) for more info."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks. updated

is_required: false
Copy link
Contributor

Choose a reason for hiding this comment

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

also please add this code to make this a drop-down list:

      value_options:
        - "METERED"
        - "UNMETERED"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

- test_package_name: ""
opts:
title: "Test Package Filename"
Expand Down