add api-samples tox target

api-samples generation is no longer straight forward, now that tox is
blocking environment changes, and that PYTHONHASHSEED is randomized in
each run.

This creates a tox target to make it easy to generate the api-samples.

Change-Id: Ie88597fecee5ce81fb29ce2cfb73b15d60f3f389
This commit is contained in:
Sean Dague 2015-12-03 17:24:53 -05:00 committed by Kevin L. Mitchell
parent a3b905fcd3
commit 6b9c534658
2 changed files with 14 additions and 2 deletions

View File

@ -7,11 +7,11 @@ tests in this directory.
To add a new api sample, add tests for the common passing and failing
cases in this directory for your extension, and modify test_samples.py
for your tests. There should be both JSON and XML tests included.
for your tests.
Then run the following command:
GENERATE_SAMPLES=True tox -e functional
tox -e api-samples
Which will create the files on doc/api_samples.

12
tox.ini
View File

@ -66,6 +66,18 @@ commands =
find . -type f -name "*.pyc" -delete
bash tools/pretty_tox.sh '{posargs}'
[testenv:api-samples]
usedevelop = True
install_command = pip install -U --force-reinstall {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
GENERATE_SAMPLES=True
PYTHONHASHSEED=0
OS_TEST_PATH=./nova/tests/functional/api_sample_tests
LANGUAGE=en_US
commands =
find . -type f -name "*.pyc" -delete
bash tools/pretty_tox.sh '{posargs}'
[testenv:functional-constraints]
usedevelop = {[testenv:functional]usedevelop}
install_command = {[testenv:common-constraints]install_command}