summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-07-21 10:03:12 -0400
committerGitHub <noreply@github.com>2021-07-21 10:03:12 -0400
commit782634334eaadb43e056571a57e76bd2ee9016f4 (patch)
treef2249ad8bbabfa7b0735c6102430a6e34bd8e528 /Makefile
parent1cb61f9d6ddfe161c9403381134717a9b8e50e7b (diff)
parent5952270950bbeeff3092d42c35099792a5401b17 (diff)
downloadpodman-782634334eaadb43e056571a57e76bd2ee9016f4.tar.gz
podman-782634334eaadb43e056571a57e76bd2ee9016f4.tar.bz2
podman-782634334eaadb43e056571a57e76bd2ee9016f4.zip
Merge pull request #10997 from edsantiago/helpfuler_expects
e2e tests: prevent 'Expect(ExitCode())' pattern
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 11 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 8e66f629a..832671337 100644
--- a/Makefile
+++ b/Makefile
@@ -261,7 +261,7 @@ codespell:
codespell -S bin,vendor,.git,go.sum,changelog.txt,.cirrus.yml,"RELEASE_NOTES.md,*.xz,*.gz,*.tar,*.tgz,bin2img,*ico,*.png,*.1,*.5,copyimg,*.orig,apidoc.go" -L uint,iff,od,seeked,splitted,marge,ERRO,hist,ether -w
.PHONY: validate
-validate: gofmt lint .gitvalidation validate.completions man-page-check swagger-check tests-included
+validate: gofmt lint .gitvalidation validate.completions man-page-check swagger-check tests-included tests-expect-exit
.PHONY: build-all-new-commits
build-all-new-commits:
@@ -605,6 +605,16 @@ test-binaries: test/checkseccomp/checkseccomp test/goecho/goecho install.cataton
tests-included:
contrib/cirrus/pr-should-include-tests
+.PHONY: tests-expect-exit
+tests-expect-exit:
+ @if egrep 'Expect.*ExitCode' test/e2e/*.go | egrep -v ', ".*"\)'; then \
+ echo "^^^ Unhelpful use of Expect(ExitCode())"; \
+ echo " Please use '.Should(Exit(...))' pattern instead."; \
+ echo " If that's not possible, please add an annotation (description) to your assertion:"; \
+ echo " Expect(...).To(..., \"Friendly explanation of this check\")"; \
+ exit 1; \
+ fi
+
###
### Release/Packaging targets
###