-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (62 loc) · 1.92 KB
/
Makefile
File metadata and controls
76 lines (62 loc) · 1.92 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
.PHONY: all docker-env install nopyc clean test test-local test-smoke test-selenium build-docker run-docker
SHELL := /usr/bin/env bash
PYTHON_BIN ?= python
CLUSTER_VENV ?= venv
ENVIRONMENT ?= prod
AWS_REGION ?= us-east-1
PROJECT_APP_HOST ?= https://www.heliumedu.com
PROJECT_API_HOST ?= https://api.heliumedu.com
ifeq ($(ENVIRONMENT), prod)
ENVIRONMENT_PREFIX := ""
else
ENVIRONMENT_PREFIX := "$(ENVIRONMENT)."
endif
all: test
docker-env:
@if [ ! -f ".env" ]; then \
cp -n .env.docker.example .env | true; \
fi
venv:
$(PYTHON_BIN) -m pip install virtualenv
$(PYTHON_BIN) -m virtualenv $(CLUSTER_VENV)
install: venv
@( \
source $(CLUSTER_VENV)/bin/activate; \
python -m pip install -r requirements.txt; \
)
nopyc:
find . -name '*.pyc' | xargs rm -f || true
find . -name __pycache__ | xargs rm -rf || true
clean: nopyc
rm -rf $(CLUSTER_VENV)
test-local:
make -C ../.. build test-cluster-legacy
test: test-selenium
test-smoke: install
@( \
source $(CLUSTER_VENV)/bin/activate; \
ENVIRONMENT=$(ENVIRONMENT) \
ENVIRONMENT_PREFIX=$(ENVIRONMENT_PREFIX) \
AWS_REGION=$(AWS_REGION) \
PROJECT_APP_HOST=$(PROJECT_APP_HOST) \
PROJECT_API_HOST=$(PROJECT_API_HOST) \
pytest -o junit_suite_name=tavern \
src/tavern/test_setup.tavern.yaml src/tavern/tests/ src/tavern/test_teardown.tavern.yaml \
--log-cli-level info --tavern-global-cfg src/tavern/common.yaml; \
)
test-selenium: install
@( \
source $(CLUSTER_VENV)/bin/activate; \
ENVIRONMENT=$(ENVIRONMENT) \
ENVIRONMENT_PREFIX=$(ENVIRONMENT_PREFIX) \
AWS_REGION=$(AWS_REGION) \
PROJECT_APP_HOST=$(PROJECT_APP_HOST) \
PROJECT_API_HOST=$(PROJECT_API_HOST) \
pytest -o junit_suite_name=selenium \
--reruns 2 --reruns-delay 5 \
src/selenium/test_setup.py src/selenium/tests/ src/selenium/test_teardown.py; \
)
build-docker:
docker buildx build -t helium/cluster-tests:latest --platform=linux/amd64 --load .
run-docker: docker-env
docker compose up -d