-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
120 lines (99 loc) · 4.07 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
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
.PHONY: test
clear-poetry-cache: # clear poetry/pypi cache. for user to do explicitly, never automatic
poetry cache clear pypi --all
configure: # does any pre-requisite installs
pip install poetry==1.4.2
lint:
@echo "Running flake8..."
@flake8 dcicutils || echo "'flake8 dcicutils' failed."
@flake8 test --exclude=data_files || echo "'flake8 test' failed."
build: # builds
make configure
poetry install
test: # runs default tests, which are the unit tests
make test-units
make test-static
make test-last
test-for-ga:
poetry run flake8 dcicutils
poetry run flake8 test --exclude=data_files
make test-units-with-coverage
make test-last
test-last:
poetry run pytest -vv -m "last"
retest: # runs only failed tests from the last test run. (if no failures, it seems to run all?? -kmp 17-Dec-2020)
poetry run pytest -vv -r w --last-failed -m "not last"
test-all: # you have to be really brave to want this. a lot of things will err
@git log -1 --decorate | head -1
@date
poetry run pytest -vv -r w -m "not last"
make test-last
@git log -1 --decorate | head -1
@date
test-most: # leaves out things that will probably err but runs unit tests and both kinds of integrations
@git log -1 --decorate | head -1
@date
poetry run pytest -vv -r w -m "not static and not beanstalk_failure and not direct_es_query and not last"
@git log -1 --decorate | head -1
@date
test-units-with-coverage:
@git log -1 --decorate | head -1
@date
poetry run coverage run --source dcicutils -m pytest -vv -r w -m "not static and not integratedx and not beanstalk_failure and not direct_es_query and not last"
make test-last
@git log -1 --decorate | head -1
@date
test-units: # runs unit tests (and integration tests not backed by a unit test)
@git log -1 --decorate | head -1
@date
poetry run pytest -vv -r w -m "not static and not integratedx and not beanstalk_failure and not direct_es_query and not last"
make test-last
@git log -1 --decorate | head -1
@date
test-integrations: # runs integration tests
@git log -1 --decorate | head -1
@date
poetry run pytest -vv -r w -m "not static and (integrated or integratedx) and not beanstalk_failure and not direct_es_query and not last"
@git log -1 --decorate | head -1
@date
test-direct-es-query: # must be called inside VPC (e.g., from foursight after cloning repo, setting up venv, etc)
@git log -1 --decorate | head -1
@date
poetry run pytest -vv -r w -m "direct_es_query and not last"
@git log -1 --decorate | head -1
@date
test-static:
@git log -1 --decorate | head -1
@date
poetry run pytest -vv -r w -m "static and not last"
poetry run flake8 dcicutils
poetry run flake8 test --exclude=data_files
@git log -1 --decorate | head -1
@date
recordings:
@scripts/create_test_recordings
update: # updates dependencies
poetry update
publish:
# New Python based publish script (2023-04-25).
poetry run publish-to-pypi
publish-for-ga:
# New Python based publish script (2023-04-25).
# For some reason, have NOT been able to get the required pip install of
# requests and toml to "take" - when using with the poetry run publish
# command - either here or in .main-publish.yml; still get module not
# found error for requests in GA; so invoking directly with python.
# poetry run publish-to-pypi --noconfirm
python -m dcicutils.scripts.publish_to_pypi --noconfirm
help:
@make info
info:
@: $(info Here are some 'make' options:)
$(info - Use 'make configure' to install poetry, though 'make build' will do it automatically.)
$(info - Use 'make lint' to check style with flake8.)
$(info - Use 'make build' to install dependencies using poetry.)
$(info - Use 'make publish' to publish this library, but only if auto-publishing has failed.)
$(info - Use 'make test' to run tests with the normal options we use on travis)
$(info - Use 'make update' to update dependencies (and the lock file))
$(info - Use 'make recordings' to refresh the recorded tests. (Always makes new recordings even if not needed.))
$(info - Use 'make clear-poetry-cache' to clear the poetry pypi cache if in a bad state. (Safe, but later recaching can be slow.))