forked from NTMC-Community/MatchZoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
70 lines (62 loc) · 1.59 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
# Usages:
#
# to install matchzoo dependencies:
# $ make init
#
# to run all matchzoo tests, recommended for big PRs and new versions:
# $ make test
#
# there are three kinds of tests:
#
# 1. "quick" tests
# - run in seconds
# - include all unit tests without marks and all doctests
# - for rapid prototyping
# - CI run this for all PRs
#
# 2. "slow" tests
# - run in minutes
# - include all unit tests marked "slow"
# - CI run this for all PRs
#
# 3. "cron" tests
# - run in minutes
# - involves underministic behavoirs (e.g. network connection)
# - include all unit tests marked "cron"
# - CI run this on a daily basis
#
# to run quick tests, excluding time consuming tests and crons:
# $ make quick
#
# to run slow tests, excluding normal tests and crons:
# $ make slow
#
# to run crons:
# $ make cron
#
# to run all tests:
# $ make test
#
# to run CI push/PR tests:
# $ make push
#
# to run docstring style check:
# $ make flake
init:
pip install -r requirements.txt
TEST_ARGS = -v --full-trace -l --doctest-modules --doctest-continue-on-failure --cov matchzoo/ --cov-report term-missing --cov-report html --cov-config .coveragerc matchzoo/ tests/ -W ignore::DeprecationWarning --ignore=matchzoo/contrib
FLAKE_ARGS = ./matchzoo --exclude=__init__.py,matchzoo/contrib
test:
pytest $(TEST_ARGS)
flake8 $(FLAKE_ARGS)
push:
pytest -m 'not cron' $(TEST_ARGS) ${ARGS}
flake8 $(FLAKE_ARGS)
quick:
pytest -m 'not slow and not cron' $(TEST_ARGS) ${ARGS}
slow:
pytest -m 'slow and not cron' $(TEST_ARGS) ${ARGS}
cron:
pytest -m 'cron' $(TEST_ARGS) ${ARGS}
flake:
flake8 $(FLAKE_ARGS) ${ARGS}