Skip to content

Commit 6d73812

Browse files
authored
add test for job passing workflow param
This important pass was missed, this test ensures our default job's logic properly assumes it should block workflow.
1 parent ac74644 commit 6d73812

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

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)