diff --git a/nova/tests/functional/api_sample_tests/README.rst b/nova/tests/functional/api_sample_tests/README.rst index 55e038a6f61b..2ada29481113 100644 --- a/nova/tests/functional/api_sample_tests/README.rst +++ b/nova/tests/functional/api_sample_tests/README.rst @@ -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. diff --git a/tox.ini b/tox.ini index 17172ad43567..ab4397a237f7 100644 --- a/tox.ini +++ b/tox.ini @@ -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}