octavia/diskimage-create/tox.ini
Michael Johnson fbe328397b Fix the diskimage-create tox "build" environment
The recently added tox "build" environment had a few problems:
1. It was not honoring the DIB_* environment variables which meant
in always built a master branch image.
2. It also failed to run repeatedly due to a cache directory path issue.
3. The built images were stored in a hidden folder ".amp_tox_test".

This patch fixes those issues, resolves a confusing
"dpkg Broken pipe" message, and adds a "Successfully built" message
at the end of the built that highlights which branch the image was
built against (master, stable/stein, etc.).

Change-Id: I826c5f753f159b2d5dee97d4e2922826444ea6da
2019-09-19 04:12:37 +00:00

37 lines
1.3 KiB
INI

[tox]
minversion = 1.8
envlist = bashate,docs,build,test
skipsdist = True
[testenv]
basepython = python3
envdir = {toxworkdir}/venv
setenv = VIRTUAL_ENV={envdir}
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY DIB_* CLOUD_INIT_DATASOURCES OCTAVIA_REPO_PATH
install_command = pip install -U {opts} {packages}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
whitelist_externals = virt-filesystems
virt-inspector
awk
mkdir
rm
[testenv:docs]
commands = doc8 README.rst ../elements/haproxy-octavia/README.rst ../elements/root-passwd/README.rst
[testenv:bashate]
commands = bashate diskimage-create.sh
bashate image-tests.sh
[testenv:build]
# NOTE: specify cache directory explicitly with -c as the `diskimage-create.sh`
# default is based off of `$HOME` which is not passed on in a `tox` environment.
commands = ./diskimage-create.sh -o {toxinidir}/amphora-x64-haproxy -w {toxworkdir} -c {toxworkdir}/.cache
[testenv:test]
# Work around tox limitations with command pipes
# https://bitbucket.org/hpk42/tox/issue/73/pipe-output-of-command-into-file
commands = ./image-tests.sh {toxinidir}/.amp_tox_test
rm -rf {toxinidir}/.amp_tox_test