make test → test_local, test_docker, test_dind
test_local: run `bats tests/`. Requires `bats`. test_docker: run docker and install bats in it. Both of these options require that your local Docker daemon is running in swarm mode. test_dind: starts a Docker daemon and runs tests in that. Requires sudo
This commit is contained in:
20
Makefile
20
Makefile
@ -1,6 +1,21 @@
|
||||
.PHONY: test shellcheck docopt kcov codecov
|
||||
|
||||
test:
|
||||
test_dind:
|
||||
@sudo DOCKER_CONTEXT=default docker run \
|
||||
-v $$(pwd):/workdir \
|
||||
--privileged \
|
||||
-d \
|
||||
--name=abra-test-dind \
|
||||
-e DOCKER_TLS_CERTDIR="" \
|
||||
docker:dind
|
||||
@DOCKER_CONTEXT=default docker exec \
|
||||
-it \
|
||||
abra-test-dind \
|
||||
sh -c "apk add bats git bash && cd /workdir && bats /workdir/tests"
|
||||
@DOCKER_CONTEXT=default docker stop abra-test-dind
|
||||
@DOCKER_CONTEXT=default docker rm abra-test-dind
|
||||
|
||||
test_docker:
|
||||
@DOCKER_CONTEXT=default docker run \
|
||||
-it \
|
||||
--rm \
|
||||
@ -8,6 +23,9 @@ test:
|
||||
docker:dind \
|
||||
sh -c "apk add bats git bash && cd /workdir && bats /workdir/tests"
|
||||
|
||||
test_local:
|
||||
bats tests
|
||||
|
||||
shellcheck:
|
||||
@docker run \
|
||||
-it \
|
||||
|
Reference in New Issue
Block a user