generated from NHSDigital/api-management-service-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (51 loc) · 1.69 KB
/
Makefile
File metadata and controls
69 lines (51 loc) · 1.69 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
SHELL=/bin/bash -euo pipefail
install: install-node install-python
install-python:
poetry install
install-node:
npm install
test:
@echo "No tests configured."
lint:
npm run lint
poetry run flake8 **/*.py
find -name '*.sh' | grep -v node_modules | xargs shellcheck
clean:
rm -rf build
rm -rf dist
publish: clean
mkdir -p build
npm run publish 2> /dev/null
serve: update-examples
npm run serve
check-licenses:
npm run check-licenses
scripts/check_python_licenses.sh
deploy-proxy: update-examples
scripts/deploy_proxy.sh
deploy-spec: update-examples
scripts/deploy_spec.sh
format:
poetry run black **/*.py
build-proxy:
scripts/build_proxy.sh
_dist_include="pytest.ini poetry.lock poetry.toml pyproject.toml Makefile build/. e2e"
release: clean publish build-proxy
mkdir -p dist
for f in $(_dist_include); do cp -r $$f dist; done
.PHONY: e2e e2e-mock
pytest := PYTEST_ADDOPTS="--color=yes" poetry run pytest --reruns 3 --reruns-delay 2 $$f --suppress-no-test-exit-code
# Since different fixtures are used in diferent files to create and modify test
# apps and products, is quite difficult to handle the state of the resources
# they create in Apigee and the order those resources need to be created or
# modified by the test. On top of that this tests rely on the Apigee API wich
# can be a bit temperamental some times presenting an async behaviour due to its
# internal caching layers. To make testing more stable we run a fresh pytest
# session for each test file (meaning fresh fixtures) increasing isolation
# between testing modules.
e2e:
rm -f reports/e2e.xml > /dev/null || true
@for f in $$(find e2e/tests -name "test_*.py") ; do \
echo $$f; \
$(pytest) || exit 1; \
done