Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions step.sh
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ echo "maestro_version: $maestro_version"
echo "metadata: $metadata"
echo "name: $name"
echo "orientation: $orientation"
echo "priority: $priority"
echo "report: $report"
echo "retry: $retry"
echo "runner_type: $runner_type"
Expand Down Expand Up @@ -222,6 +223,7 @@ ${maestro_version:+--maestro-version \"$maestro_version\"} \
${name:+--name \"$name\"} \
${check_name:+-m \"gh_check_name=$check_name\"} \
${orientation:+--orientation \"$orientation\"} \
${priority:+--priority \"$priority\"} \
${report:+--report \"$report\"} \
${retry:+--retry \"$retry\"} \
${runner_type:+--runner-type \"$runner_type\"} \
Expand Down Expand Up @@ -277,6 +279,7 @@ ${maestro_version:+--maestro-version "$maestro_version"} \
${name:+--name "$name"} \
${check_name:+-m "gh_check_name=$check_name"} \
${orientation:+--orientation "$orientation"} \
${priority:+--priority "$priority"} \
${report:+--report "$report"} \
${retry:+--retry "$retry"} \
${runner_type:+--runner-type "$runner_type"} \
Expand Down
16 changes: 16 additions & 0 deletions step.yml
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,22 @@ inputs:
is_expand: true
is_required: false

- priority: ""
opts:
title: "Priority"
summary: "Run priority within your organization (low, normal or high). Reorders only your own queued runs; never moves them ahead of other customers. Leave empty for normal."
description: |-
Decides which of your organization's own queued runs starts first, across
your whole concurrency pool, for every flow in this run. It never makes a
run start earlier relative to other customers: your organization keeps the
same place in the shared queue, and priority only picks which of your runs
uses it. Runs queued longer than 6 hours are promoted first, so `low` runs
are never starved, and retries keep the run's priority.
Options: `low`, `normal`, `high`. Leave empty for the default, `normal`.
is_expand: true
is_required: false

- render_engine: ""
opts:
title: "Render Engine"
Expand Down
17 changes: 16 additions & 1 deletion test/test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ STUB
# runner may have exported so each test specifies exactly what it wants.
unset api_key app_file workspace android_device android_api_level ios_device \
name check_name async google_play debug disable_animations use_beta \
env_list metadata download_artifacts json_file cancel_previous \
env_list metadata download_artifacts json_file cancel_previous priority \
include_github_context DCD_STEP_VERSION \
STUB_STATUS STUB_CLOUD_EXIT STUB_STATUS_FIXTURE STUB_STATUS_RAW
# ...and the Bitrise env vars the GitHub context is derived from, in case
Expand Down Expand Up @@ -214,6 +214,21 @@ teardown() {
[[ "$output" != *"--cancel-previous"* ]]
}

@test "passes --priority only when priority is set" {
export api_key="k"

export priority="high"
run bash "${TEST_DIR}/step.sh"
[ "$status" -eq 0 ]
[[ "$output" == *"STUB_CLOUD_CALLED_WITH:"*"--priority high"* ]]
[[ "$output" == *'--priority "high"'* ]]

export priority=""
run bash "${TEST_DIR}/step.sh"
[ "$status" -eq 0 ]
[[ "$output" != *"--priority"* ]]
}

@test "boolean flags appear only when their inputs are true" {
export api_key="k"
export google_play="true"
Expand Down
Loading