Commit Graph

41 Commits

Author SHA1 Message Date
YAMAMOTO Takashi b7fe6cc6f0 Remove run_tests.sh
It was deprecated while ago. [1]

[1] Ic68858aaf1a519085dff394e6edc8c8fe6aeee6a

Change-Id: Ib3431760cd828edc78a1dd36829f19d72bbe1116
2017-09-13 14:06:15 -06:00
Ihar Hrachyshka 3e341a9941 Fix post gate hook to accommodate for new os-testr
New os-testr uses stestr under the hood, which creates .stestr but not
.testrepository directory in the current dir. Other than that, it
doesn't seem like there is any difference in the format or names of
files generated in the directory.

Change-Id: I82d52bf0ad885bd36d2f0782a7c86ac61df532f2
Closes-Bug: #1716746
2017-09-12 14:20:12 -06:00
Victor Morales a14439549f Add bashate support
Bashate is a style checker program for bash scripts.  This addition
improves the quality of the current bash scripts and ensures that
any future change will follow the same standards.

Change-Id: Ia346f77632d4ac7beb288fa3aacea221d7969c87
2017-02-25 06:29:55 +00:00
Henry Gessau e8e4e5d7ab Deprecate run_tests.sh
We support tox for testing.
We don't maintain anything else.
In the Pike release we will remove the script.

Change-Id: Ic68858aaf1a519085dff394e6edc8c8fe6aeee6a
2016-11-08 03:50:20 +00:00
pawnesh.kumar 9a6e3f9dc5 Removed unnecessary file(openstack/common) in run_stack.sh
Change-Id: I67899d6e4ec1f21b8a330ceb857f384c181c0587
2016-10-20 16:33:23 +05:30
Maru Newby e37dcd4c76 Remove check for bash usage
Arbitrarily restricting ourselves from using bash because developers on
platforms like netbsd don't want to install bash from ports doesn't
make sense.  Any non-trivial shell script is likely to use features
like arrays or string manipulation that are poorly supported (if at
all) by sh, and the continued bumping of the number of expected bash
scripts is an indication that the check is not serving its purpose
anyway.

Along with removing the check, all shebang references to /bin/bash
have been replaced with /usr/bin/env bash in an attempt to be more
compatible across different hosts.

Change-Id: Ief72dc380cc88af38959c330897e2c127e33c332
Closes-Bug: #1440824
2015-04-07 15:15:33 +00:00
armando-migliaccio c229b58cf2 Revert "monkey patch stdlib before importing other modules"
The projects that depend on Neutron do not play nicely with this.

This reverts commit 24b11ded7f.

Change-Id: Ic7afd7de9db97cc3a085bc842a2d990519cf42f6
2015-02-11 17:26:33 -08:00
Terry Wilson 24b11ded7f monkey patch stdlib before importing other modules
Some oslo libraries assume that stdlib is already patched when
they are imported (e.g. oslo_concurrency.processutils tests the
'time' module for monkey_patching to detect which 'subprocess'
module to import.

This can cause issues when things like test frameworks import
modules that monkey_patch, as the order imports are made can break
this kind of check. It is always good to monkey patch as soon as
possible, hence trying to do the patching in neutron/__init__.py.

This is an alternative to https://review.openstack.org/#/c/153225/
which just patches neutron/tests/__init__.py. Unfortunately, just
monkey_patching in tests/__init__.py didn't fix all of the issues
I ran into. For example, tempest tests were failing with timeouts.

Closes-bug: #1418541
Change-Id: I7f2115a99acae5b6d61aab2f7334f498b8d99858
2015-02-09 19:49:27 -06:00
Ihar Hrachyshka 35d838ff60 Migrate to oslo.concurrency
Namespaces are not used anymore, so imports are for oslo_concurrency,
not oslo.concurrency.

lockutils direct call is not supported anymore, so using shipped
lockutils-wrapper instead.

Use ExternalLockFixture to set lock_path for unit testing.

Updated cache and cache/_backends module from oslo-incubator to use
oslo.concurrency and not incubator version of lockutils module.

Dropped lockutils incubator module that is now moved to oslo.concurrency. Not
dropping fixture module that includes lockutils fixture since other fixtures
are still used in the tree.

Closes-Bug: #1387092
Change-Id: I2ba2295f8f5d55f272a9d23555940586b25b5a1c
2015-01-15 21:01:06 +01:00
Doug Wiegley 5a43874658 run_tests.sh OS X script fixes
On OS X, '*' is not a valid grep modified for '[^[:space:]:]', nor is it
necessary when the lines being checked against must be prefixed with
neutron.tests.
Also, dirname was being called with an empty var, without quoting, resulting
in usage errors.

Closes-Bug: 1391858

Change-Id: I34ab0625a00809f68b7a44cb3a175a57ba0bd6d5
2014-11-20 17:56:19 -07:00
Akihiro Motoki e33a07bc44 Provide a quick way to run flake8
"run_tests.sh -p" always checks every file for errors even though you
have probably only changed a handful. This patch adds "run_tests.sh -8"
which only checks the files that were modified in the HEAD commit or
in the current working tree.

It is borrowed from the recent nova commit b011325cc6.
The related ML post is:
http://lists.openstack.org/pipermail/openstack-dev/2014-August/043346.html

Change-Id: Ieeabf1b79a0790af8bde3144dca59b4245a0b79a
2014-08-30 21:30:17 +09:00
Terry Wilson 7355521a50 Restore ability to run functional tests with run_tests.sh
Change f20b1d42 which split the running of functional tests from
the running of unit tests caused running:
  ./run_tests.sh neutron.tests.functional
to fail as the OS_TEST_PATH variable will be defaulted to
neutron.tests.unit which means that the functional tests will not
be discovered in the above case.

This patch trys to detect an argument passed in the form of a
neutron.tests string and correctly sets the OS_TEST_PATH variable
based on it.

Change-Id: I8ccdc7f10d3c8478281aeaf8d02175d0eeb8d6e9
2014-04-23 10:37:35 -05:00
Jenkins 525aa406ce Merge "Don't document non-existing flag '--hide-elapsed'" 2014-02-22 04:05:04 +00:00
Sascha Peilicke 1651e99ca8 Don't document non-existing flag '--hide-elapsed'
Closes-Bug: 1277051
Change-Id: I4435645025dabcecf3dc1b7168ce17f10d6df534
2014-02-06 13:12:16 +01:00
Justin Hammond 024c693eff Fix interprocess locks for run_tests.sh
This was fixed for nova using this method and we are porting it here as we are
running into a similar bug as #1264058

Closes-Bug: #1269938
Change-Id: I06a2684629fd7b4d30e2d7716dc00a2ed0479f2f
2014-01-16 20:47:58 +00:00
Kui Shi 3555240db3 Don't need to init testr in run_tests.sh
In run_tests.sh, function init_testr will initialize testr if the
directory .testrepository is not existed. Actually, testr will do
the check before run the test:

In Python package testrepository, setuptools_command.py:Testr.run

68 def run(self):
69     """Set up testr repo, then run testr"""
70     if not os.path.isdir(".testrepository"):
71         self._run_testr("init")

So, init_testr can be removed safely.

Fixes Bug #1224285

Change-Id: Ia74d9fff92b8efba9b72e5c7387f761144daa193
2013-09-12 01:04:09 +08:00
Mark McClain ee3fe4e836 Rename Quantum to Neutron
This change renames everything to Neutron while providing backwards
compatible adjustments for Grizzly configuration files.

implements blueprint: remove-use-of-quantum

Change-Id: Ie7d07ba7c89857e13d4ddc8f0e9b68de020a3d19
2013-07-06 15:02:43 -04:00
Monty Taylor a5062315f5 Revert "Fix ./run_tests.sh --pep8"
We are explicitly trying to get rid of scripts like this and flake8 makes
this one non-necessary.
Fix run_tests.sh to run flake8 properly.

This reverts commit 42243d6eb2

Change-Id: I435e34b6acde7931a75f456ccc88da6476581643
2013-05-22 13:51:07 +09:00
Akihiro MOTOKI 42243d6eb2 Fix ./run_tests.sh --pep8
Create a common script to call flake8 to share flake8 options and
make tox and run_tests.sh use this script.

Fixes bug: 1179331

Change-Id: I92dc54fa3f4bb22aa39bde226b6d769088f9a2e3
2013-05-14 11:28:37 +09:00
Tim Miller 147038a613 Parallelize quantum unit testing:
This change switches run_tests.sh to use testr
in parallel mode, instead of nosetests, in order
to enable unit tests to run in parallel.

By default, the number of parallel test processes
is set to the number of cores on the test machine.

A similar change was recently merged to nova:
  https://review.openstack.org/#/c/15078/

Some tests required updating to remove inter-testcase
dependencies.

bug #1099694

Change-Id: Idfb923d424342a07dcba88d70b971683f549f763
2013-04-03 14:17:48 -07:00
Dan Prince 3abf094150 Make run_tests.sh pep8 conf match tox.
Updates our run_tests.sh pep8 excludes so that match what we do
in tox.ini (Adds E711,E712 to the exclude list)

Change-Id: Iaf2cee898a957847d444aa7c48db1d4ad088ab6e
2013-03-05 21:01:02 -05:00
Matthew Treinish 30e0b120e9 Add an update option to run_tests.sh
This commit adds an update option to run_tests.sh. This option
is used to rerun install_venv.py on an already installed venv.
This will then just update out of date packages with pip.

Change-Id: I49a1cbcb62e7f429eca3efe949b8aa90507723c4
2013-02-15 15:43:13 -05:00
Dan Prince 991619e64a Don't force run_tests.sh pep8 only to use -N.
Previously running run_tests.sh -p would *always* run
outside of the virtual environment. This commit makes -p
work equally well with -N (no-virtual-env) and -V (virtual-env).

Change-Id: I214404e85af2122b2ea7330e6496848a1e0d7ddf
2012-11-25 22:01:27 -05:00
Zhongyue Luo 1fafffb8c2 Exclude openstack-common from pep8 test
Fixes bug #1048962

Added "openstack" to PEP8_EXCLUDE in run_tests.sh

Change-Id: I5919c97681b1f037e231df7ddb449c2a16366128
2012-09-11 14:50:13 +08:00
Yaguang Tang 5fcf6ccd95 fix bug lp:1025526,update iniparser.py to accept empty value.
also,this patch turn off pep8 E125 check,this for now seems to
be unnecessary,it check continuous line split.and update the
latest openstack-common https://review.openstack.org/#/c/9201
which has fix pep8 1.3 issue except for E125 check.

Change-Id: I86e6a3add56a0a2941031a1248f1696667ac56b8
2012-07-19 18:46:19 +08:00
Yong Sheng Gong 3cff1e7b97 Introduce files from openstack common.
Because the openstack common project does not stick to latest pep8 rules,
I have to exclude some bad-ruled files in the tox.ini and run_tests.sh.
However pep8 does not support exclude option in the format quantum/openstack/common,
so I have to exclude some of openstack common files one by one.

Also, I have changed the Qunatum Context to base on the common context.

I does not update the setup.py in our openstack common dir and the one
under quantum top dir, since it should be maintained in a consistent way
across all of openstack projects.

After this introduction, we are ready for notification feature.

Change-Id: I2729c2dc3958835374c88d704e842e613785ec14
2012-07-17 06:41:14 +08:00
Monty Taylor d643608e33 Getting ready for the client split.
Change-Id: Ic2e7d637d2c116dfda3d7ad958ccba39a8da7751
2012-01-19 11:43:18 +11:00
James E. Blair c6ffd875df Base version.py on glance.
This makes setting and calculating the versioning of quantum more
like other OpenStack projects, simplifying the work of the CI
and Release Management teams.

Addresses bug 916018 which prevents the quantum-tarball job from
running correctly.

Change-Id: I5b006ccc3d31c5d213c703853dfa38f04d983918
2012-01-17 16:24:34 +11:00
James E. Blair a90fab1193 Rename .quantum-venv to .venv.
This simplifies a number of Jenkins jobs which currently, other
than directory names, could be the same for all OpenStack
projects. By renaming the virtualenv directory, the redundant
Jenkins virtualenv build and copy jobs can be eliminated.

Change-Id: I93c7f6577b4c3a76b021f002bda59fcb8fac3f95
2011-12-23 15:02:57 -08:00
Salvatore Orlando 6f697a341e Bug #890028
Change run_tests.sh for running pep8/pylint validation only
(also adds .pylintrc file)

Resubmitting this time making sure we run pylint for Quantum!
Also run just with -l for total number of messages
Run with -l -v for detailed pylint messages

Change-Id: I593c8aed4e0e6b06204c6c4308934da198778fd6
2011-12-14 00:33:37 +00:00
Brad Hall 6a08320031 Second round of packaging changes
This change condenses the directory structure to something more similar to
what we had before while producing similar packages.

It also introduces version.py which allows us to get the version from git tags
(or a fallback version if not available).

Fixes lp bug 889336
Fixes lp bug 888795

Change-Id: I86136bd9dbabb5eb1f8366ed665ed9b54f695124
2011-11-28 10:33:52 -08:00
Brad Hall 7c29727304 Fix for bug 877525
We now have a verbose flag (-v) for run_tests.sh if you want ot see all that
crap printed to the screen.  The default behavior is just to print "test nam
.. OK".  Also, we took the code from nova to cat run_tests.log if there is a
error so that if we hit an import error we will see it in the console jenkin
output.

Change-Id: Id8997c658a61691bf9f25b1c01e6a5db0eca428f
2011-11-05 04:48:54 -07:00
Salvatore Orlando a1707183be Bug 887706
Adding *.pyc to PEP8_EXCLUDE

Change-Id: If2c432e8ce85be585aa3b71a5acb76f2f27a4c07
2011-11-08 18:25:01 +00:00
Tyler Smith 24b0207cbe blueprint quantum-packaging
Change-Id: Ica19170540b06ecddb0fbb6d340ee7a6819c1708
2011-03-07 18:02:05 -05:00
Brad Hall 342b8362ee Add code-coverage support to run_tests.sh (lp860160)
Change-Id: I404ba58ea882123b8c6669ea32923fa626b27de5
2011-10-02 15:46:29 -07:00
Brad Hall 559aedc3d9 Merge from launchpad quantum/diablo branch:
merge salv's fix to remove keystone middleware: lp855151
  one more 202->200 from tyler
  merge tylers additional 202 -> 200 changes
  merge additions to OVS readme describing running with multiple hosts
  merge brad's changes to make create API calls return 200, not 202
  merge unit test for showing unset attachment
  merging API docs branch
  Merge: lp:~yinliu2/quantum/bug856564
  Merge: lp:~bgh/quantum/bug850261

Change-Id: I56fe24c59f918737e57b562343c33ec6dcceac60
2011-09-23 20:17:44 -07:00
James E. Blair 9390937103 Get output from run_tests.
Remove output redirection from run_tests.
Remove PEP8 from run_tests; it's called from a separate jenkins job.

Change-Id: I6476a3031fe7a52ac52bec5d2ce75ced9590ab2a
2011-09-16 09:52:31 -07:00
Dan Wendlandt 2b17f003b8 undo unintentional formatting change in run_tests.sh 2011-08-06 22:18:25 -07:00
Dan Wendlandt 4fffb10e43 refactoring testing code to support plugin tests 2011-08-06 22:03:52 -07:00
Salvatore Orlando d0cb0eea78 Work in progress - just starting 2011-06-28 18:04:27 +01:00
Santhosh 6458fa7cff Santhosh/Vinkesh | Added the testing framework. Moved the smoketest to tests/functional 2011-06-08 14:22:51 +05:30