Skip to content

Commit 2a0544d

Browse files
bors[bot]mu-broilya.artamonoveddiewebb
authored
Merge #50
50: Pass block-workflow parameter to until_front_of_line step [semver:patch] r=eddiewebb a=mu-bro ### Motivation, issues **_block-workflow_** parameter is not passed from **queue/block_workflow** job to **until_front_of_line** step, therefore block-workflow is always set to 'false'. Co-authored-by: Ilya Artamonov <[email protected]> Co-authored-by: ilya.artamonov <[email protected]> Co-authored-by: Eddie Webb <[email protected]>
2 parents 56bf4a7 + 6d73812 commit 2a0544d

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/jobs/block_workflow.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ resource_class: small
3535
steps:
3636
- until_front_of_line:
3737
consider-branch: <<parameters.consider-branch>>
38+
block-workflow: <<parameters.block-workflow>>
3839
time: <<parameters.time>>
3940
dont-quit: <<parameters.dont-quit>>
4041
only-on-branch: <<parameters.only-on-branch>>

test/test_expansion.bats

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,3 +355,25 @@ function setup {
355355

356356
}
357357

358+
359+
@test "Default job sets block workflow properly" {
360+
# given
361+
process_config_with test/inputs/fulljob.yml
362+
363+
# when
364+
assert_jq_match '.jobs | length' 1 #only 1 job
365+
assert_jq_match '.jobs["Single File"].steps | length' 1 #only 1 steps
366+
367+
jq -r '.jobs["Single File"].steps[0].run.command' $JSON_PROJECT_CONFIG > ${BATS_TMPDIR}/script-${BATS_TEST_NUMBER}.bash
368+
369+
export CIRCLECI_API_KEY="madethisup"
370+
export CIRCLE_BUILD_NUM="2"
371+
export CIRCLE_JOB="singlejob"
372+
export CIRCLE_PROJECT_USERNAME="madethisup"
373+
export CIRCLE_PROJECT_REPONAME="madethisup"
374+
export CIRCLE_REPOSITORY_URL="madethisup"
375+
export CIRCLE_BRANCH="madethisup"
376+
377+
run bash ${BATS_TMPDIR}/script-${BATS_TEST_NUMBER}.bash
378+
assert_contains_text "Orb parameter block-workflow is true."
379+
}

0 commit comments

Comments
 (0)