generate coverage reports in make test, open as html site
This commit is contained in:
parent
79e6850a84
commit
1c51982c6b
|
@ -14,3 +14,10 @@ eth2.0-spec-tests/
|
||||||
# Dynamically built from Markdown spec
|
# Dynamically built from Markdown spec
|
||||||
test_libs/pyspec/eth2spec/phase0/spec.py
|
test_libs/pyspec/eth2spec/phase0/spec.py
|
||||||
test_libs/pyspec/eth2spec/phase1/spec.py
|
test_libs/pyspec/eth2spec/phase1/spec.py
|
||||||
|
|
||||||
|
# coverage reports
|
||||||
|
.htmlcov
|
||||||
|
.coverage
|
||||||
|
|
||||||
|
# local CI testing output
|
||||||
|
test_libs/pyspec/test-reports
|
||||||
|
|
14
Makefile
14
Makefile
|
@ -21,8 +21,10 @@ PY_SPEC_PHASE_1_DEPS = $(SPEC_DIR)/core/1_*.md
|
||||||
|
|
||||||
PY_SPEC_ALL_TARGETS = $(PY_SPEC_PHASE_0_TARGETS) $(PY_SPEC_PHASE_1_TARGETS)
|
PY_SPEC_ALL_TARGETS = $(PY_SPEC_PHASE_0_TARGETS) $(PY_SPEC_PHASE_1_TARGETS)
|
||||||
|
|
||||||
|
COV_INDEX_FILE=$(PY_SPEC_DIR)/.htmlcov/index.html
|
||||||
|
|
||||||
.PHONY: clean all test citest lint gen_yaml_tests pyspec phase0 phase1 install_test install_deposit_contract_test test_deposit_contract compile_deposit_contract
|
.PHONY: clean all test citest lint gen_yaml_tests pyspec phase0 phase1 install_test open_cov \
|
||||||
|
install_deposit_contract_test test_deposit_contract compile_deposit_contract
|
||||||
|
|
||||||
all: $(PY_SPEC_ALL_TARGETS) $(YAML_TEST_DIR) $(YAML_TEST_TARGETS)
|
all: $(PY_SPEC_ALL_TARGETS) $(YAML_TEST_DIR) $(YAML_TEST_TARGETS)
|
||||||
|
|
||||||
|
@ -41,11 +43,15 @@ install_test:
|
||||||
cd $(PY_SPEC_DIR); python3 -m venv venv; . venv/bin/activate; pip3 install -r requirements-testing.txt;
|
cd $(PY_SPEC_DIR); python3 -m venv venv; . venv/bin/activate; pip3 install -r requirements-testing.txt;
|
||||||
|
|
||||||
test: $(PY_SPEC_ALL_TARGETS)
|
test: $(PY_SPEC_ALL_TARGETS)
|
||||||
cd $(PY_SPEC_DIR); . venv/bin/activate; python -m pytest eth2spec
|
cd $(PY_SPEC_DIR); . venv/bin/activate; export PYTHONPATH="./"; \
|
||||||
|
python -m pytest --cov=eth2spec.phase0.spec --cov=eth2spec.phase1.spec --cov-report="html:.htmlcov" --cov-branch eth2spec
|
||||||
|
|
||||||
citest: $(PY_SPEC_ALL_TARGETS)
|
citest: $(PY_SPEC_ALL_TARGETS)
|
||||||
cd $(PY_SPEC_DIR); mkdir -p test-reports/eth2spec; . venv/bin/activate; \
|
cd $(PY_SPEC_DIR); mkdir -p test-reports/eth2spec; . venv/bin/activate; \
|
||||||
python -m pytest --junitxml=test-reports/eth2spec/test_results_phase0.xml eth2spec
|
python -m pytest --junitxml=test-reports/eth2spec/test_results.xml eth2spec
|
||||||
|
|
||||||
|
open_cov:
|
||||||
|
((open "$(COV_INDEX_FILE)" || xdg-open "$(COV_INDEX_FILE)") &> /dev/null) &
|
||||||
|
|
||||||
lint: $(PY_SPEC_ALL_TARGETS)
|
lint: $(PY_SPEC_ALL_TARGETS)
|
||||||
cd $(PY_SPEC_DIR); . venv/bin/activate; \
|
cd $(PY_SPEC_DIR); . venv/bin/activate; \
|
||||||
|
|
|
@ -2,3 +2,4 @@
|
||||||
pytest>=3.6,<3.7
|
pytest>=3.6,<3.7
|
||||||
../config_helpers
|
../config_helpers
|
||||||
flake8==3.7.7
|
flake8==3.7.7
|
||||||
|
pytest-cov
|
||||||
|
|
Loading…
Reference in New Issue