-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (42 loc) · 1.57 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
CONTAINER_IMAGE=$(shell bash scripts/container_image.sh)
PYTHON ?= "python3"
PYTEST_OPTS ?= "-s -vvv"
PYTEST_DIR ?= "tests"
ABACO_DEPLOY_OPTS ?= "-p"
SCRIPT_DIR ?= "scripts"
PREF_SHELL ?= "bash"
ACTOR_ID ?=
NOCLEANUP ?= 0
GITREF=$(shell git rev-parse --short HEAD)
REACTOR_ENV_FILE="env.json"
.PHONY: tests container tests-local tests-reactor tests-deployed
.SILENT: tests container tests-local tests-reactor tests-deployed
all: image
true
image:
abaco deploy -R -t $(GITREF) $(ABACO_DEPLOY_OPTS)
shell:
REACTOR_ENV_FILE="env.json" USEPWD=1 bash $(SCRIPT_DIR)/run_container_process.sh bash
tests: tests-pytest tests-local
tests-pytest: image
REACTOR_ENV_FILE="env.json" USEPWD=1 bash $(SCRIPT_DIR)/run_container_process.sh python3 -m "pytest" $(PYTEST_DIR) $(PYTEST_OPTS)
tests-integration:
true
tests-local: image tests-local-file tests-local-dir tests-munged-file
tests-local-file:
REACTOR_ENV_FILE="env.json" USEPWD=1 bash $(SCRIPT_DIR)/run_container_message.sh tests/data/local-message-01.json
tests-local-dir:
REACTOR_ENV_FILE="env.json" USEPWD=1 bash $(SCRIPT_DIR)/run_container_message.sh tests/data/local-message-02.json
tests-munged-file:
REACTOR_ENV_FILE="env.json" USEPWD=1 bash $(SCRIPT_DIR)/run_container_message.sh tests/data/local-message-03.json
tests-deployed:
echo "not implemented"
clean: clean-image clean-tests
clean-image:
docker rmi -f $(CONTAINER_IMAGE)
clean-tests:
rm -rf .hypothesis .pytest_cache __pycache__ */__pycache__ tmp.* *junit.xml
deploy:
abaco deploy -t $(GITREF) $(ABACO_DEPLOY_OPTS) -U $(ACTOR_ID)
postdeploy:
bash tests/run_after_deploy.sh