-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Shay Arbov
committed
Dec 11, 2017
1 parent
44ef750
commit e46441a
Showing
8 changed files
with
99 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
FROM python:2.7 | ||
#FROM python:3.6 | ||
|
||
# Install Docker | ||
ENV DOCKER_CONFIG=/tmp/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM python:3.6 | ||
|
||
# Install Docker | ||
ENV DOCKER_CONFIG=/tmp/ | ||
RUN curl https://get.docker.com/builds/Linux/x86_64/docker-latest.tgz | tar xz -C /tmp/ \ | ||
&& chmod +x /tmp/docker && mv -f /tmp/docker/* /usr/local/bin/ | ||
|
||
# Install packages required for the tests | ||
COPY test-requirements.txt /tmp/test-requirements.txt | ||
RUN pip install --no-cache-dir -r /tmp/test-requirements.txt | ||
|
||
# Install the package requirements | ||
COPY requirements.txt /tmp/requirements.txt | ||
RUN pip install --no-cache-dir -r /tmp/requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,13 @@ | ||
# *** WARNING: Targets are meant to run in a build container - Use skipper make *** | ||
all: py27 py36 | ||
|
||
# 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 | ||
py27: | ||
# Run the internal make file using python 2.7 container | ||
skipper --build-container-image=py27-build make | ||
|
||
all: coverage nose2 pytest dist/docker-test-tools-*.tar.gz | ||
|
||
flake8: | ||
flake8 docker_test_tools | ||
|
||
pylint: | ||
mkdir -p build/ | ||
PYLINTHOME=reports/ pylint -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=69 -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/ | ||
|
||
dist/docker-test-tools-*.tar.gz: | ||
# Create the source distribution | ||
python setup.py sdist | ||
py36: | ||
# Run the internal make file using python 3.6 container | ||
skipper --build-container-image=py36-build make | ||
|
||
clean: | ||
# Clean any generated files | ||
rm -rf build dist docker_test_tools.egg-info .coverage .cache | ||
rm -rf build dist docker_test_tools.egg-info .coverage .cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# *** 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: coverage nose2 pytest dist/docker-test-tools-*.tar.gz | ||
|
||
flake8: | ||
flake8 docker_test_tools | ||
|
||
pylint: | ||
mkdir -p build/ | ||
PYLINTHOME=reports/ pylint -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=69 -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/ | ||
|
||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
registry: rackattack-nas.dc1:5000 | ||
build-container-image: build | ||
build-container-image: py27-build | ||
build-container-net: example_tests-network | ||
make: | ||
makefile: Makefile.internal |