Skip to content

Commit 3a747e0

Browse files
committed
Moved generic variables out of tests
1 parent 65cff8f commit 3a747e0

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

tests/command.bats

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ load "${BATS_PLUGIN_PATH}/load.bash"
88
# export DOCKER_STUB_DEBUG=/dev/tty
99
# export DU_STUB_DEBUG=/dev/tty
1010

11+
export artifacts_tmp="tests/tmp/junit-artifacts"
12+
export annotation_tmp="tests/tmp/junit-annotation"
13+
14+
1115
@test "runs the annotator and creates the annotation" {
1216
export BUILDKITE_PLUGIN_JUNIT_ANNOTATE_ARTIFACTS="junits/*.xml"
1317
export BUILDKITE_PLUGIN_JUNIT_ANNOTATE_FAIL_BUILD_ON_ERROR=false
1418

15-
artifacts_tmp="tests/tmp/$PWD/junit-artifacts"
16-
annotation_tmp="tests/tmp/$PWD/junit-annotation"
17-
1819
stub mktemp \
1920
"-d junit-annotate-plugin-artifacts-tmp.XXXXXXXXXX : mkdir -p $artifacts_tmp; echo $artifacts_tmp" \
2021
"-d junit-annotate-plugin-annotation-tmp.XXXXXXXXXX : mkdir -p $annotation_tmp; echo $annotation_tmp"
@@ -39,9 +40,6 @@ load "${BATS_PLUGIN_PATH}/load.bash"
3940
export BUILDKITE_PLUGIN_JUNIT_ANNOTATE_ARTIFACTS="junits/*.xml"
4041
export BUILDKITE_PLUGIN_JUNIT_ANNOTATE_FAIL_BUILD_ON_ERROR=true
4142

42-
artifacts_tmp="tests/tmp/$PWD/junit-artifacts"
43-
annotation_tmp="tests/tmp/$PWD/junit-annotation"
44-
4543
stub mktemp \
4644
"-d junit-annotate-plugin-artifacts-tmp.XXXXXXXXXX : mkdir -p $artifacts_tmp; echo $artifacts_tmp" \
4745
"-d junit-annotate-plugin-annotation-tmp.XXXXXXXXXX : mkdir -p $annotation_tmp; echo $annotation_tmp"
@@ -67,9 +65,6 @@ load "${BATS_PLUGIN_PATH}/load.bash"
6765
export BUILDKITE_PLUGIN_JUNIT_ANNOTATE_FAIL_BUILD_ON_ERROR=false
6866
export BUILDKITE_PLUGIN_JUNIT_ANNOTATE_CONTEXT="junit_custom_context"
6967

70-
artifacts_tmp="tests/tmp/$PWD/junit-artifacts"
71-
annotation_tmp="tests/tmp/$PWD/junit-annotation"
72-
7368
stub mktemp \
7469
"-d junit-annotate-plugin-artifacts-tmp.XXXXXXXXXX : mkdir -p $artifacts_tmp; echo $artifacts_tmp" \
7570
"-d junit-annotate-plugin-annotation-tmp.XXXXXXXXXX : mkdir -p $annotation_tmp; echo $annotation_tmp"
@@ -93,9 +88,6 @@ load "${BATS_PLUGIN_PATH}/load.bash"
9388
@test "doesn't create annotation unless there's failures" {
9489
export BUILDKITE_PLUGIN_JUNIT_ANNOTATE_ARTIFACTS="junits/*.xml"
9590

96-
artifacts_tmp="tests/tmp/$PWD/junit-artifacts"
97-
annotation_tmp="tests/tmp/$PWD/junit-annotation"
98-
9991
stub mktemp \
10092
"-d junit-annotate-plugin-artifacts-tmp.XXXXXXXXXX : mkdir -p $artifacts_tmp; echo $artifacts_tmp" \
10193
"-d junit-annotate-plugin-annotation-tmp.XXXXXXXXXX : mkdir -p $annotation_tmp; echo $annotation_tmp"
@@ -124,9 +116,6 @@ load "${BATS_PLUGIN_PATH}/load.bash"
124116
@test "fails if the annotation is larger than 1MB" {
125117
export BUILDKITE_PLUGIN_JUNIT_ANNOTATE_ARTIFACTS="junits/*.xml"
126118

127-
artifacts_tmp="tests/tmp/$PWD/junit-artifacts"
128-
annotation_tmp="tests/tmp/$PWD/junit-annotation"
129-
130119
stub mktemp \
131120
"-d junit-annotate-plugin-artifacts-tmp.XXXXXXXXXX : mkdir -p $artifacts_tmp; echo $artifacts_tmp" \
132121
"-d junit-annotate-plugin-annotation-tmp.XXXXXXXXXX : mkdir -p $annotation_tmp; echo $annotation_tmp"
@@ -154,9 +143,6 @@ load "${BATS_PLUGIN_PATH}/load.bash"
154143
export BUILDKITE_PLUGIN_JUNIT_ANNOTATE_ARTIFACTS="junits/*.xml"
155144
export BUILDKITE_PLUGIN_JUNIT_ANNOTATE_FAIL_BUILD_ON_ERROR=true
156145

157-
artifacts_tmp="tests/tmp/$PWD/junit-artifacts"
158-
annotation_tmp="tests/tmp/$PWD/junit-annotation"
159-
160146
stub mktemp \
161147
"-d junit-annotate-plugin-artifacts-tmp.XXXXXXXXXX : mkdir -p $artifacts_tmp; echo $artifacts_tmp" \
162148
"-d junit-annotate-plugin-annotation-tmp.XXXXXXXXXX : mkdir -p $annotation_tmp; echo $annotation_tmp"

0 commit comments

Comments
 (0)