-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
69 lines (52 loc) · 1.98 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
# install cardano_node_tests and its dependencies
install:
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade wheel
python3 -m pip install --upgrade --upgrade-strategy eager -r requirements-dev.txt
virtualenv --upgrade-embed-wheels
# install dependencies that are needed for building documentation
install_doc:
python3 -m pip install --upgrade --upgrade-strategy eager -r requirements-doc.txt
# run linters
lint:
pre-commit run -a
if type pytype >/dev/null 2>&1; then pytype cardano_node_tests; fi
# generate sphinx documentation
.PHONY: doc
doc:
mkdir -p src_docs/build
$(MAKE) -C src_docs clean
$(MAKE) -C src_docs html
# run tests
ARTIFACTS_DIR ?= .artifacts
COVERAGE_DIR ?= .cli_coverage
ALLURE_DIR ?= .reports
ifneq ($(MARKEXPR),)
MARKEXPR := -m "$(MARKEXPR)"
endif
# it may not be always necessary to save artifacts, e.g. when running tests on local cluster
# on local machine
ifndef NO_ARTIFACTS
ARTIFACTS_ARGS := --artifacts-base-dir=$(ARTIFACTS_DIR)
endif
.dirs:
mkdir -p $(ARTIFACTS_DIR) $(COVERAGE_DIR) $(ALLURE_DIR)
.run_tests:
# First just skip all tests so Allure has a list of runable tests. Run only if no pytest args were specified.
ifndef PYTEST_ARGS
rm -f $(ALLURE_DIR)/{*-attachment.txt,*-result.json,*-container.json}
pytest -s cardano_node_tests $(MARKEXPR) --skipall --alluredir=$(ALLURE_DIR) >/dev/null
endif
# run tests for real and produce Allure results
pytest cardano_node_tests $(PYTEST_ARGS) $(CI_ARGS) $(MARKEXPR) -n $(TEST_THREADS) $(ARTIFACTS_ARGS) --cli-coverage-dir=$(COVERAGE_DIR) --alluredir=$(ALLURE_DIR)
# run all tests, generate allure report
tests: export DbSyncAbortOnPanic=1
tests: TEST_THREADS := $(or $(TEST_THREADS),15)
tests: .dirs .run_tests
# run all enabled tests on testnet, generate allure report
testnets: export NOPOOLS=1
testnets: export CLUSTERS_COUNT=1
testnets: export FORBID_RESTART=1
testnets: TEST_THREADS := $(or $(TEST_THREADS),20)
testnets: MARKEXPR := $(or $(MARKEXPR),-m "testnets")
testnets: .dirs .run_tests