File tree Expand file tree Collapse file tree 2 files changed +50
-3
lines changed Expand file tree Collapse file tree 2 files changed +50
-3
lines changed Original file line number Diff line number Diff line change @@ -15,14 +15,22 @@ workflows:
1515 branches :
1616 ignore :
1717 - master
18- - test :
18+ - publish_dev :
1919 requires :
2020 - validate
2121 filters :
2222 branches :
2323 only :
2424 - staging
2525 - trying
26+ - test :
27+ requires :
28+ - publish_dev
29+ filters :
30+ branches :
31+ only :
32+ - staging
33+ - trying
2634 - publish :
2735 requires :
2836 - test
3947 - checkout
4048 - install-circleci
4149 - pack-and-validate
42- test :
50+ publish_dev :
4351 docker :
4452 - image : cimg/base:2019.08
4553 working_directory : ~/repo
@@ -56,11 +64,24 @@ jobs:
5664 echo "export ORB_VERSION=\"${ORB_VERSION}\"" >> $BASH_ENV
5765 echo $ORB_VERSION
5866 echo "export PR_MESSAGE=\"BotComment: *Development* version of orb available for manual validation - \\\`${ORB_VERSION}\\\`\"" >> $BASH_ENV
67+
68+ test :
69+ docker :
70+ - image : cimg/base:2019.08
71+ working_directory : ~/repo
72+ parallelism : 4
73+ steps :
74+ - checkout
75+ - install-circleci
76+ - pack-and-validate
77+ - pr-info
5978 - install-bats
6079 - run :
6180 name : Import Tests using BATS
6281 command : |
6382 export BATS_IMPORT_DEV_ORB="eddiewebb/<<pipeline.parameters.orbname>>@dev:${PR_NUMBER}"
83+ export BATS_TEST_LIST=$(bats -l test | cirleci split)
84+ echo "This node will run ${BATS_TEST_LIST}"
6485 bats test
6586 - pr-comment
6687
@@ -101,7 +122,9 @@ commands:
101122 - run :
102123 name : Install BATS (bash testing)
103124 command : |
104- cd /tmp && git clone https://github.com/bats-core/bats-core.git && cd bats-core
125+ # my fork includes tets list for splitting
126+ cd /tmp && git clone https://github.com/eddiewebb/bats-core.git && cd bats-core
127+ cp
105128 ./install.sh /usr/local
106129 - run :
107130 name : Install YQ
Original file line number Diff line number Diff line change @@ -51,6 +51,30 @@ function setup {
5151}
5252
5353
54+
55+ @test " Default job sets block workflow properly" {
56+ # given
57+ process_config_with test/inputs/fulljob.yml
58+
59+ # when
60+ assert_jq_match ' .jobs | length' 1 # only 1 job
61+ assert_jq_match ' .jobs["Single File"].steps | length' 1 # only 1 steps
62+
63+ jq -r ' .jobs["Single File"].steps[0].run.command' $JSON_PROJECT_CONFIG > ${BATS_TMPDIR} /script-${BATS_TEST_NUMBER} .bash
64+
65+ export CIRCLECI_API_KEY=" madethisup"
66+ export CIRCLE_BUILD_NUM=" 2"
67+ export CIRCLE_JOB=" singlejob"
68+ export CIRCLE_PROJECT_USERNAME=" madethisup"
69+ export CIRCLE_PROJECT_REPONAME=" madethisup"
70+ export CIRCLE_REPOSITORY_URL=" madethisup"
71+ export CIRCLE_BRANCH=" madethisup"
72+
73+ run bash ${BATS_TMPDIR} /script-${BATS_TEST_NUMBER} .bash
74+ assert_contains_text " Orb parameter block-workflow is true."
75+ }
76+
77+
5478# See https://github.com/eddiewebb/circleci-queue/issues/26 for explanation of race condition
5579@test " Race condition on previous workflow does not fool us" {
5680 # given
You can’t perform that action at this time.
0 commit comments