forked from datarobot-oss/custom-models-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (51 loc) · 1.46 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
60
61
62
63
FUNCTIONAL_TESTS ?= tests/functional
ifeq ($(FUNCTIONAL_TESTS),tests/functional)
BASIC_FUNCTIONAL_TEST = tests/functional/test_deployment_github_actions.py::TestDeploymentGitHubActions::test_e2e_deployment_create
else
BASIC_FUNCTIONAL_TEST = $(FUNCTIONAL_TESTS)
endif
validate-env-%:
@if [ "${$*}" = "" ]; then \
printf "\033[0;31m\nEnvironment variable '${*}' is not set. Aborting.\n\n\033[0m"; \
exit 1; \
fi
reqs:
pip install -r tests/requirements.txt
.PHONY: reqs
test: test-unit
.PHONY: test
test-full: test-unit test-functional
.PHONY: test-full
test-unit:
set -ex; PYTHONPATH=.:src pytest tests/unit
.PHONY: test-unit
test-functional: validate-env-DATAROBOT_WEBSERVER validate-env-DATAROBOT_API_TOKEN
set -ex; PYTHONPATH=.:src \
pytest \
-v \
--log-cli-level=debug \
--log-cli-date-format="%Y-%m-%d %H:%M:%S" \
--log-cli-format="%(asctime)s [%(levelname)-5s] %(message)s" \
${FLAGS} ${FUNCTIONAL_TESTS}
.PHONY: test-functional
test-functional-basic: validate-env-DATAROBOT_WEBSERVER validate-env-DATAROBOT_API_TOKEN
set -ex; PYTHONPATH=.:src \
pytest \
-v \
--log-cli-level=debug \
--log-cli-date-format="%Y-%m-%d %H:%M:%S" \
--log-cli-format="%(asctime)s [%(levelname)-5s] %(message)s" \
${FLAGS} ${BASIC_FUNCTIONAL_TEST}
.PHONY: test-functional-basic
black:
@isort --profile black .
@black .
.PHONY: black
black-check:
@black --check .
.PHONY: black-check
lint: black-check
@flake8 .
@isort --check-only .
@pylint --recursive=y .
.PHONY: lint