-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
105 lines (76 loc) · 2.86 KB
/
Makefile
File metadata and controls
105 lines (76 loc) · 2.86 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
project_name = eligibility-signposting-api-regression-tests
.PHONY: test
guard-%:
@ if [ "${${*}}" = "" ]; then \
echo "Parameter $* needed!"; \
exit 1; \
fi
install: install-python install-hooks install-node
install-full: install-asdf-plugins install
uninstall-full: clear-virtualenv asdf-uninstall
update: update-poetry update-node install
update-node:
npm update
update-poetry:
poetry update
install-asdf-plugins:
@cut -d' ' -f1 .tool-versions | while read plugin; do \
if ! asdf plugin list | grep -qx "$$plugin"; then \
echo "➕ Adding asdf plugin: $$plugin"; \
asdf plugin add "$$plugin"; \
else \
echo "✔ Plugin already installed: $$plugin"; \
fi; \
done
@asdf install
install-node:
npx npm@11.6.3 ci
install-python:
poetry config virtualenvs.in-project true --local
poetry install
install-hooks: install-python
poetry run pre-commit install --install-hooks --overwrite
lint-black:
poetry run black .
lint-pyright:
export PYRIGHT_PYTHON_GLOBAL_NODE=0; poetry run pyright .
lint-flake8:
poetry run flake8 .
lint: lint-black lint-pyright lint-flake8
check-licenses:
scripts/check_python_licenses.sh
clear-virtualenv:
poetry env remove
rm -f -d -r node_modules
asdf-uninstall:
asdf plugin list | xargs -n 1 asdf plugin remove
deep-clean-install:
make clear-virtualenv
make asdf-uninstall
make install-full
pre-commit:
poetry run pre-commit run --all-files
setup-db: guard-env guard-log_level
poetry run pytest --env=${env} --log-cli-level=${log_level} tests/test_reset_db.py tests/test_preload_data.py
run-performance-tests: guard-env guard-log_level guard-users guard-spawn_rate guard-run_time setup-db
poetry run pytest \
--env=${env} \
--log-cli-level=${log_level} \
--perf-users=${users} \
--perf-spawn-rate=${spawn_rate} \
--perf-run-time=${run_time} \
-s tests/performance_tests/test_performance_tests.py
run-tests: guard-env guard-log_level setup-db
DYNAMO_PRELOADED=true poetry run pytest --env=${env} --log-cli-level=${log_level} tests/test_story_tests.py tests/test_error_scenario_tests.py tests/test_vita_integration_tests.py tests/test_nbs_integration_tests.py
ifeq ($(filter $(env),test dev),$(env))
DYNAMO_PRELOADED=true poetry run pytest --env=${env} --log-cli-level=${log_level} tests/test_hashing_tests.py
endif
ifeq ($(filter $(env),preprod),$(env))
DYNAMO_PRELOADED=true poetry run pytest --env=${env} --log-cli-level=${log_level} tests/test_upload_consumer_configs.py
endif
run-vita-preprod-tests:
poetry run pytest --env=preprod --log-cli-level=info tests/test_vita_integration_tests.py tests/test_upload_consumer_configs.py
run-nbs-preprod-tests:
poetry run pytest --env=preprod --log-cli-level=info tests/test_nbs_integration_tests.py tests/test_upload_consumer_configs.py
run-unit-tests: guard-env guard-log_level
poetry run pytest --env=${env} --log-cli-level=${log_level} tests/test_error_handling_utils.py -v