-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile.internal
48 lines (35 loc) · 1.42 KB
/
Makefile.internal
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
# *** WARNING: Targets are meant to run in a build container - Use skipper make ***
# Get docker api version and set the compose file version accordingly
DOCKER_API_VERSION = $(shell python docker_test_tools/api_version.py)
COMPOSE_FILE_VERSION = $(shell python -c 'print("2.1" if "$(DOCKER_API_VERSION)" >= "1.24" else "2")')
DTT_COMPOSE_PATH=tests/resources/docker-compose-v$(COMPOSE_FILE_VERSION).yml
all: pylint flake8 coverage nose2 pytest dist/docker-test-tools-*.tar.gz
flake8:
flake8 docker_test_tools
pylint:
mkdir -p build/
PYLINTHOME=reports/ pylint -d W0612 -r n docker_test_tools
test:
# Run the unittests and create a junit-xml report
mkdir -p build/
nose2 --config=tests/ut/nose2.cfg --verbose --project-directory .
coverage: test
# Create a coverage report and validate the given threshold
coverage html --fail-under=60 -d build/coverage
nose2:
mkdir -p build/
# Run the example nose2 tests - validate the package works
DTT_COMPOSE_PATH=$(DTT_COMPOSE_PATH) \
nose2 --config=tests/integration/nose2.cfg --verbose --project-directory .
pytest:
mkdir -p build/
# Run the example pytest tests - validate the package works
DTT_COMPOSE_PATH=$(DTT_COMPOSE_PATH) \
pytest -v tests/integration/
build: dist/docker-test-tools-*.tar.gz
dist/docker-test-tools-*.tar.gz:
# Create the source distribution
python setup.py sdist
clean:
# Clean any generated files
rm -rf build dist docker_test_tools.egg-info .coverage .cache