File tree Expand file tree Collapse file tree 2 files changed +29
-4
lines changed Expand file tree Collapse file tree 2 files changed +29
-4
lines changed Original file line number Diff line number Diff line change
1
+ /tests /tmp
Original file line number Diff line number Diff line change 2
2
3
3
load " $BATS_PATH /load.bash"
4
4
5
- @test " calls git log" {
6
- stub git " log : echo some-log"
7
- git log
5
+ # Uncomment to get debug output from each stub
6
+ # export MKTEMP_STUB_DEBUG=/dev/tty
7
+ # export BUILDKITE_AGENT_STUB_DEBUG=/dev/tty
8
+ # export DOCKER_STUB_DEBUG=/dev/tty
9
+
10
+ @test " runs the annotator and creates the annotation" {
11
+ export BUILDKITE_PLUGIN_JUNIT_ANNOTATE_ARTIFACTS=" junits/*.xml"
12
+
13
+ artifacts_tmp=" tests/tmp/$PWD /junit-artifacts"
14
+ annotation_tmp=" tests/tmp/$PWD /junit-annotation"
15
+
16
+ stub mktemp \
17
+ " -d junit-annotate-plugin-artifacts-tmp.XXXXXXXXXX : mkdir -p $artifacts_tmp ; echo $artifacts_tmp " \
18
+ " -d junit-annotate-plugin-annotation-tmp.XXXXXXXXXX : mkdir -p $annotation_tmp ; echo $annotation_tmp "
19
+
20
+ stub buildkite-agent " artifact download junits/*.xml /plugin/tests/tmp//plugin/junit-artifacts : echo Downloaded artifacts" \
21
+ " annotate --context junit --style error : echo Annotation added"
22
+
23
+ stub docker " --log-level error run --rm --volume /plugin/tests/tmp//plugin/junit-artifacts:/junits --volume /plugin/hooks/../ruby:/src --env BUILDKITE_PLUGIN_JUNIT_ANNOTATE_JOB_UUID_FILE_PATTERN= ruby:2.5-alpine /src/bin/annotate /junits : echo ANNOTATION"
24
+
25
+ run " $PWD /hooks/command"
26
+
8
27
assert_success
9
- unstub git
28
+
29
+ assert_output --partial " Annotation added"
30
+
31
+ unstub mktemp
32
+ unstub buildkite-agent
33
+ unstub docker
10
34
}
You can’t perform that action at this time.
0 commit comments