Skip to content

Commit 46a3b4d

Browse files
committed
Check for running containers at "make test"
Signed-off-by: Ulysses Souza <[email protected]>
1 parent 30d7b3a commit 46a3b4d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
.DEFAULT_GOAL := help
22

3+
.PHONY: check
4+
check: ## Checks the environment before running any command
5+
@[[ $(shell docker ps -aq | wc -l) == 0 ]] || \
6+
(echo "You have to remove any containers before running the tests! Please run 'docker rm -f \`docker ps -aq\`' to remove all the existing containers." && exit 1)
7+
38
.PHONY: images
49
images: ## Build the test images
510
docker build server -t test-server
611

712
.PHONY: test
8-
test: images ## Run tests
13+
test: check images ## Run tests
914
GOPRIVATE=github.com/compose-spec/compatibility-test-suite go test ./... -v
1015

1116
.PHONY: fmt

0 commit comments

Comments
 (0)