2020-10-26 17:04:14 +00:00
|
|
|
.PHONY: test shellcheck docopt kcov codecov
|
2020-09-08 06:48:53 +00:00
|
|
|
|
2020-12-31 20:10:52 +00:00
|
|
|
test_dind:
|
|
|
|
@sudo DOCKER_CONTEXT=default docker run \
|
|
|
|
-v $$(pwd):/workdir \
|
|
|
|
--privileged \
|
|
|
|
-d \
|
|
|
|
--name=abra-test-dind \
|
|
|
|
-e DOCKER_TLS_CERTDIR="" \
|
2021-01-01 11:26:50 +00:00
|
|
|
decentral1se/docker-dind-bats-kcov
|
2020-12-31 20:10:52 +00:00
|
|
|
@DOCKER_CONTEXT=default docker exec \
|
|
|
|
-it \
|
|
|
|
abra-test-dind \
|
2021-01-01 11:26:50 +00:00
|
|
|
sh -c "cd /workdir && bats /workdir/tests"
|
2020-12-31 20:10:52 +00:00
|
|
|
@DOCKER_CONTEXT=default docker stop abra-test-dind
|
|
|
|
@DOCKER_CONTEXT=default docker rm abra-test-dind
|
|
|
|
|
|
|
|
test_docker:
|
2020-10-30 16:30:43 +00:00
|
|
|
@DOCKER_CONTEXT=default docker run \
|
2020-10-26 16:49:21 +00:00
|
|
|
-it \
|
|
|
|
--rm \
|
2020-10-26 17:01:12 +00:00
|
|
|
-v $$(pwd):/workdir \
|
2021-01-01 11:26:50 +00:00
|
|
|
decentral1se/docker-dind-bats-kcov \
|
|
|
|
sh -c "cd /workdir && bats /workdir/tests"
|
2020-09-08 07:19:03 +00:00
|
|
|
|
2020-12-31 20:10:52 +00:00
|
|
|
test_local:
|
|
|
|
bats tests
|
|
|
|
|
2020-10-26 17:04:14 +00:00
|
|
|
shellcheck:
|
|
|
|
@docker run \
|
|
|
|
-it \
|
|
|
|
--rm \
|
|
|
|
-v $$(pwd):/workdir \
|
|
|
|
koalaman/shellcheck-alpine \
|
|
|
|
shellcheck /workdir/abra
|
|
|
|
|
2020-10-25 20:41:17 +00:00
|
|
|
docopt:
|
|
|
|
@if [ ! -d ".venv" ]; then \
|
|
|
|
python3 -m venv .venv && \
|
|
|
|
.venv/bin/pip install -U pip setuptools wheel && \
|
|
|
|
.venv/bin/pip install docopt-sh; \
|
|
|
|
fi
|
|
|
|
.venv/bin/docopt.sh abra
|
|
|
|
|
2020-10-26 17:01:12 +00:00
|
|
|
kcov:
|
|
|
|
@docker run \
|
|
|
|
-it \
|
|
|
|
--rm \
|
|
|
|
-v $$(pwd):/workdir \
|
|
|
|
kcov/kcov:latest \
|
2020-10-29 23:34:37 +00:00
|
|
|
sh -c "kcov /workdir/coverage /workdir/abra || true"
|
2020-10-25 20:41:17 +00:00
|
|
|
|
2020-10-26 17:01:12 +00:00
|
|
|
codecov: SHELL:=/bin/bash
|
|
|
|
codecov:
|
|
|
|
@bash <(curl -s https://codecov.io/bash) \
|
|
|
|
-s coverage -t $$(pass show hosts/swarm.autonomic.zone/drone/codecov/token)
|