Browse Source

Add tox functional target

Create a formal tox target for functional tests.
Also we should not be overriding the user's localrc.

Closes-Bug: #1440125
Change-Id: Ide639ea89050cf3e1f1e9e40c687d506998f7587
changes/57/170757/4
Davanum Srinivas 7 years ago
parent
commit
79ac06cc4b
  1. 7
      devstack/settings
  2. 21
      magnum/tests/contrib/post_test_hook.sh
  3. 6
      tox.ini

7
devstack/settings

@ -13,13 +13,6 @@ TENANT_VLAN_RANGE=
PHYSICAL_NETWORK=public
OVS_PHYSICAL_BRIDGE=br-ex
# Credentials
ADMIN_PASSWORD=password
DATABASE_PASSWORD=password
RABBIT_PASSWORD=password
SERVICE_PASSWORD=password
SERVICE_TOKEN=password
enable_service rabbit
# Enable Neutron which is required by Magnum and disable nova-network.

21
magnum/tests/contrib/post_test_hook.sh

@ -32,20 +32,23 @@ echo_summary "magnum's post_test_hook.sh was called..."
sudo pip install -r test-requirements.txt
# Try a command line as a sanity check
source ../devstack/accrc/admin/admin
# Get admin credentials
pushd ../devstack
source openrc admin admin
popd
echo_summary "Running bay-list"
magnum --debug bay-list
sudo OS_STDOUT_CAPTURE=-1 OS_STDERR_CAPTURE=-1 OS_TEST_TIMEOUT=500 OS_TEST_LOCK_PATH=${TMPDIR:-'/tmp'} \
python -m subunit.run discover -t ./ ./magnum/tests/functional | subunit-2to1 | tools/colorizer.py
RETVAL=$?
# Restore xtrace
$XTRACE
# Run functional tests
echo "Running magnum functional test suite"
sudo -H -u stack tox -e functional
EXIT_CODE=$?
# Save the logs
sudo mv ../logs/* /opt/stack/logs/
exit $RETVAL
# Restore xtrace
$XTRACE
exit $EXIT_CODE

6
tox.ini

@ -12,6 +12,12 @@ deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = python setup.py testr --slowest --testr-args='{posargs}'
[testenv:functional]
setenv = OS_TEST_PATH=./magnum/tests/functional
OS_TEST_TIMEOUT=500
deps =
{[testenv]deps}
[testenv:pep8]
commands = flake8

Loading…
Cancel
Save