Skip to content

Commit

Permalink
add smoketest job to make sure exit statuses are propagated (#34)
Browse files Browse the repository at this point in the history
add a pretty tiny job to test buildevents `cmd` with both `true` and `false` as commands, to make sure the former succeeds and the latter fails.
  • Loading branch information
toshok authored Jul 16, 2019
1 parent 98e2ac5 commit 42adc5b
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,31 @@ jobs:
- buildevents.tar
- store_artifacts:
path: artifacts/

smoketest:
executor: linuxgo
steps:
- buildevents/with_job_span:
steps:
- attach_workspace:
at: artifacts
- run: tar -xvf artifacts/buildevents.tar
- run:
name: "Subcommand success = success"
command: |
result=$(artifacts/buildevents-linux-amd64 cmd buildId stepId name -- true >/dev/null && echo "worked")
if [ "$result" != "worked" ]; then
exit 1
fi
- run:
name: "Subcommand failure = failure"
command: |
result=$(artifacts/buildevents-linux-amd64 cmd buildId stepId name -- false > /dev/null || echo "worked" )
if [ "$result" != "worked" ]; then
exit 1
fi
publish:
docker:
- image: cibuilds/github:0.12.1
Expand Down Expand Up @@ -128,9 +153,15 @@ workflows:
filters:
tags:
only: /.*/
- publish:
- smoketest:
requires:
- build
filters:
tags:
only: /.*/
- publish:
requires:
- smoketest
filters:
tags:
only: /^v.*/
Expand Down

0 comments on commit 42adc5b

Please sign in to comment.