2012-02-29 21:42:26 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
function usage {
|
|
|
|
echo "Usage: $0 [OPTION]..."
|
2012-03-27 05:48:48 +00:00
|
|
|
echo "Run python-glanceclient's test suite(s)"
|
2012-02-29 21:42:26 +00:00
|
|
|
echo ""
|
2013-06-09 09:07:27 +00:00
|
|
|
echo " -p, --pep8 Just run flake8"
|
2012-02-29 21:42:26 +00:00
|
|
|
echo " -h, --help Print this usage message"
|
|
|
|
echo ""
|
Use tox for running tests locally.
See: http://wiki.openstack.org/ProjectTestingInterface
Tox can manage virtualenvs, and is currently doing so for running
tests in Jenkins. It's just as, or more, useful for running tests
locally, so this starts the migration from the run_tests system to
tox. The goal is to reduce duplicate testing infrastructure, and
get what's running locally on developer workstations as close to
what is run by Jenkins as possible.
This patch removes run_tests.py, and the scripts that manage .venv.
It makes run_tests.sh call tox to facilitate the transition for
developers used to typing "run_tests.sh".
Developers will need tox installed on their workstations. It can
be installed from PyPI with "pip install tox". run_tests.sh outputs
those instructions if tox is not present.
New facilities are available using tox directly, including:
tox -e py26 # run tests under python 2.6
tox -e py27 # run tests under python 2.7
tox -e pep8 # run pep8 tests
tox # run all of the above
tox -e venv foo # run the command "foo" inside a virtualenv
The configuration of the openstack nose plugin is removed from
setup.cfg and added to the nosetests command line arguments in tox.
It is used when running tox from the command line, so the enhanced,
colorized output is visible to developers running the test suite
locally. However, when Jenkins runs tox, the xunit plugin will be
used instead, providing output natively understood by jenkins which
is much more readable in that context.
Change-Id: Id678c2fb8a5a7d79c680d3d1f2f12141f73dc8a6
2012-04-26 17:40:10 +00:00
|
|
|
echo "This script is deprecated and currently retained for compatibility."
|
|
|
|
echo 'You can run the full test suite for multiple environments by running "tox".'
|
|
|
|
echo 'You can run tests for only python 2.7 by running "tox -e py27", or run only'
|
2013-06-09 09:07:27 +00:00
|
|
|
echo 'the flake8 tests with "tox -e pep8".'
|
2012-02-29 21:42:26 +00:00
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
Use tox for running tests locally.
See: http://wiki.openstack.org/ProjectTestingInterface
Tox can manage virtualenvs, and is currently doing so for running
tests in Jenkins. It's just as, or more, useful for running tests
locally, so this starts the migration from the run_tests system to
tox. The goal is to reduce duplicate testing infrastructure, and
get what's running locally on developer workstations as close to
what is run by Jenkins as possible.
This patch removes run_tests.py, and the scripts that manage .venv.
It makes run_tests.sh call tox to facilitate the transition for
developers used to typing "run_tests.sh".
Developers will need tox installed on their workstations. It can
be installed from PyPI with "pip install tox". run_tests.sh outputs
those instructions if tox is not present.
New facilities are available using tox directly, including:
tox -e py26 # run tests under python 2.6
tox -e py27 # run tests under python 2.7
tox -e pep8 # run pep8 tests
tox # run all of the above
tox -e venv foo # run the command "foo" inside a virtualenv
The configuration of the openstack nose plugin is removed from
setup.cfg and added to the nosetests command line arguments in tox.
It is used when running tox from the command line, so the enhanced,
colorized output is visible to developers running the test suite
locally. However, when Jenkins runs tox, the xunit plugin will be
used instead, providing output natively understood by jenkins which
is much more readable in that context.
Change-Id: Id678c2fb8a5a7d79c680d3d1f2f12141f73dc8a6
2012-04-26 17:40:10 +00:00
|
|
|
command -v tox > /dev/null 2>&1
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo 'This script requires "tox" to run.'
|
|
|
|
echo 'You can install it with "pip install tox".'
|
2021-07-07 12:44:02 +00:00
|
|
|
exit 1;
|
Use tox for running tests locally.
See: http://wiki.openstack.org/ProjectTestingInterface
Tox can manage virtualenvs, and is currently doing so for running
tests in Jenkins. It's just as, or more, useful for running tests
locally, so this starts the migration from the run_tests system to
tox. The goal is to reduce duplicate testing infrastructure, and
get what's running locally on developer workstations as close to
what is run by Jenkins as possible.
This patch removes run_tests.py, and the scripts that manage .venv.
It makes run_tests.sh call tox to facilitate the transition for
developers used to typing "run_tests.sh".
Developers will need tox installed on their workstations. It can
be installed from PyPI with "pip install tox". run_tests.sh outputs
those instructions if tox is not present.
New facilities are available using tox directly, including:
tox -e py26 # run tests under python 2.6
tox -e py27 # run tests under python 2.7
tox -e pep8 # run pep8 tests
tox # run all of the above
tox -e venv foo # run the command "foo" inside a virtualenv
The configuration of the openstack nose plugin is removed from
setup.cfg and added to the nosetests command line arguments in tox.
It is used when running tox from the command line, so the enhanced,
colorized output is visible to developers running the test suite
locally. However, when Jenkins runs tox, the xunit plugin will be
used instead, providing output natively understood by jenkins which
is much more readable in that context.
Change-Id: Id678c2fb8a5a7d79c680d3d1f2f12141f73dc8a6
2012-04-26 17:40:10 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
just_pep8=0
|
|
|
|
|
2012-02-29 21:42:26 +00:00
|
|
|
function process_option {
|
|
|
|
case "$1" in
|
|
|
|
-h|--help) usage;;
|
2012-03-27 05:48:48 +00:00
|
|
|
-p|--pep8) let just_pep8=1;;
|
2012-02-29 21:42:26 +00:00
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
for arg in "$@"; do
|
|
|
|
process_option $arg
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ $just_pep8 -eq 1 ]; then
|
Use tox for running tests locally.
See: http://wiki.openstack.org/ProjectTestingInterface
Tox can manage virtualenvs, and is currently doing so for running
tests in Jenkins. It's just as, or more, useful for running tests
locally, so this starts the migration from the run_tests system to
tox. The goal is to reduce duplicate testing infrastructure, and
get what's running locally on developer workstations as close to
what is run by Jenkins as possible.
This patch removes run_tests.py, and the scripts that manage .venv.
It makes run_tests.sh call tox to facilitate the transition for
developers used to typing "run_tests.sh".
Developers will need tox installed on their workstations. It can
be installed from PyPI with "pip install tox". run_tests.sh outputs
those instructions if tox is not present.
New facilities are available using tox directly, including:
tox -e py26 # run tests under python 2.6
tox -e py27 # run tests under python 2.7
tox -e pep8 # run pep8 tests
tox # run all of the above
tox -e venv foo # run the command "foo" inside a virtualenv
The configuration of the openstack nose plugin is removed from
setup.cfg and added to the nosetests command line arguments in tox.
It is used when running tox from the command line, so the enhanced,
colorized output is visible to developers running the test suite
locally. However, when Jenkins runs tox, the xunit plugin will be
used instead, providing output natively understood by jenkins which
is much more readable in that context.
Change-Id: Id678c2fb8a5a7d79c680d3d1f2f12141f73dc8a6
2012-04-26 17:40:10 +00:00
|
|
|
tox -e pep8
|
|
|
|
exit
|
2012-02-29 21:42:26 +00:00
|
|
|
fi
|
|
|
|
|
Use tox for running tests locally.
See: http://wiki.openstack.org/ProjectTestingInterface
Tox can manage virtualenvs, and is currently doing so for running
tests in Jenkins. It's just as, or more, useful for running tests
locally, so this starts the migration from the run_tests system to
tox. The goal is to reduce duplicate testing infrastructure, and
get what's running locally on developer workstations as close to
what is run by Jenkins as possible.
This patch removes run_tests.py, and the scripts that manage .venv.
It makes run_tests.sh call tox to facilitate the transition for
developers used to typing "run_tests.sh".
Developers will need tox installed on their workstations. It can
be installed from PyPI with "pip install tox". run_tests.sh outputs
those instructions if tox is not present.
New facilities are available using tox directly, including:
tox -e py26 # run tests under python 2.6
tox -e py27 # run tests under python 2.7
tox -e pep8 # run pep8 tests
tox # run all of the above
tox -e venv foo # run the command "foo" inside a virtualenv
The configuration of the openstack nose plugin is removed from
setup.cfg and added to the nosetests command line arguments in tox.
It is used when running tox from the command line, so the enhanced,
colorized output is visible to developers running the test suite
locally. However, when Jenkins runs tox, the xunit plugin will be
used instead, providing output natively understood by jenkins which
is much more readable in that context.
Change-Id: Id678c2fb8a5a7d79c680d3d1f2f12141f73dc8a6
2012-04-26 17:40:10 +00:00
|
|
|
tox -e py27 $toxargs 2>&1 | tee run_tests.err.log || exit
|
|
|
|
if [ ${PIPESTATUS[0]} -ne 0 ]; then
|
|
|
|
exit ${PIPESTATUS[0]}
|
|
|
|
fi
|
2012-02-29 21:42:26 +00:00
|
|
|
|
Use tox for running tests locally.
See: http://wiki.openstack.org/ProjectTestingInterface
Tox can manage virtualenvs, and is currently doing so for running
tests in Jenkins. It's just as, or more, useful for running tests
locally, so this starts the migration from the run_tests system to
tox. The goal is to reduce duplicate testing infrastructure, and
get what's running locally on developer workstations as close to
what is run by Jenkins as possible.
This patch removes run_tests.py, and the scripts that manage .venv.
It makes run_tests.sh call tox to facilitate the transition for
developers used to typing "run_tests.sh".
Developers will need tox installed on their workstations. It can
be installed from PyPI with "pip install tox". run_tests.sh outputs
those instructions if tox is not present.
New facilities are available using tox directly, including:
tox -e py26 # run tests under python 2.6
tox -e py27 # run tests under python 2.7
tox -e pep8 # run pep8 tests
tox # run all of the above
tox -e venv foo # run the command "foo" inside a virtualenv
The configuration of the openstack nose plugin is removed from
setup.cfg and added to the nosetests command line arguments in tox.
It is used when running tox from the command line, so the enhanced,
colorized output is visible to developers running the test suite
locally. However, when Jenkins runs tox, the xunit plugin will be
used instead, providing output natively understood by jenkins which
is much more readable in that context.
Change-Id: Id678c2fb8a5a7d79c680d3d1f2f12141f73dc8a6
2012-04-26 17:40:10 +00:00
|
|
|
if [ -z "$toxargs" ]; then
|
|
|
|
tox -e pep8
|
2012-02-29 21:42:26 +00:00
|
|
|
fi
|