-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
88 lines (65 loc) · 2.86 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
all: typecheck typecoverage coverageclean test coverage quality
test-reports:
mkdir test-reports
coverageclean:
rm -fr .coverage
typecoverageclean:
rm -fr .mypy_cache
clean: coverageclean typecoverageclean
FILES=$$(find . -name \*.pyc); for f in $${FILES}; do rm $$f; done
typecheck:
mypy --cobertura-xml-report typecover --html-report typecover .
mypy tests tests/integration
typecoverage:
python setup.py mypy_ratchet
citypecoverage: typecoverage
@echo "Looking for un-checked-in type coverage metrics..."
@git status --porcelain metrics/mypy_high_water_mark
@test -z "$$(git status --porcelain metrics/mypy_high_water_mark)"
unit:
ENV=test nosetests --cover-package=records_mover --cover-erase --with-coverage --with-xunit --cover-html --cover-xml --cover-inclusive tests/unit
mv .coverage .coverage-unit
component:
ENV=test nosetests --cover-package=records_mover --with-coverage --with-xunit --cover-html --cover-xml --cover-inclusive tests/component
mv .coverage .coverage-component
test: unit component
coverage combine .coverage-unit .coverage-component # https://stackoverflow.com/questions/7352319/nosetests-combined-coverage
coverage html --directory=cover
coverage xml
ciunit:
ENV=test nosetests --cover-package=records_mover --cover-erase --with-coverage --with-xunit --cover-html --cover-xml --cover-inclusive --xunit-file=test-reports/junit.xml tests/unit
mv .coverage .coverage-unit
cicomponent:
ENV=test nosetests --cover-package=records_mover --with-coverage --with-xunit --cover-html --cover-xml --cover-inclusive --xunit-file=test-reports/junit.xml tests/component
mv .coverage .coverage-component
citest: test-reports ciunit cicomponent
coverage combine .coverage-unit .coverage-component # https://stackoverflow.com/questions/7352319/nosetests-combined-coverage
coverage html --directory=cover
coverage xml
coverage:
python setup.py coverage_ratchet
cicoverage: coverage
@echo "Looking for un-checked-in unit test coverage metrics..."
@git status --porcelain metrics/coverage_high_water_mark
@test -z "$$(git status --porcelain metrics/coverage_high_water_mark)"
flake8:
flake8 --filename='*.py,*.pyi' records_mover tests types
quality-flake8:
make QUALITY_TOOL=flake8 quality
quality-punchlist:
make QUALITY_TOOL=punchlist quality
quality-bigfiles:
make QUALITY_TOOL=bigfiles quality
quality-mdl:
make QUALITY_TOOL=mdl quality
# to run a single item, you can do: make QUALITY_TOOL=bigfiles quality
quality:
@quality_gem_version=$$(python -c 'import yaml; print(yaml.safe_load(open(".circleci/config.yml","r"))["quality_gem_version"])'); \
docker run \
-v "$$(pwd):/usr/app" \
-v "$$(pwd)/Rakefile.quality:/usr/quality/Rakefile" \
"apiology/quality:$${quality_gem_version}" ${QUALITY_TOOL}
package:
python3 setup.py sdist bdist_wheel
docker:
docker build -f tests/integration/Dockerfile --progress=plain -t records-mover .