Commit Graph

37 Commits

Author SHA1 Message Date
Julien Danjou
5c2f9d17de Remove old traces of the oslo-incubator
There's no need to keep that around.

Change-Id: If1ee25645ed12cd81eef32a013022c89ea3cfd5f
2015-09-09 09:11:05 +02:00
Pawel Koniszewski
a6943a9eda Provide a quick way to run flake8
Patch copied from nova:
https://review.openstack.org/#/c/110746/

'run_tests.sh -p' always checks every file for errors.
This patch adds 'run_tests.sh -8' which only checks the files
that were modified in HEAD commit or the current working tree.

time ./run_tests.sh -p
Running flake8 ...
./glance/async/eventlet_executor.py:29:80: E501 line too
long (82 > 79 characters)

real    0m11.489s
user    0m11.342s
sys     0m0.136s

time ./run_tests.sh -8
Running flake8 on doc/source/configuring.rst
etc/glance-api.conf glance/async/eventlet_executor.py run_tests.sh
./glance/async/eventlet_executor.py:29:80: E501 line too
long (82 > 79 characters)

real    0m0.604s
user    0m0.549s
sys     0m0.059s

Change-Id: I5fa9e85da017da3989a76caf95831f3ac927d1b7
2014-12-29 02:15:36 -05:00
Zhi Yan Liu
882049a613 Using oslo.concurrency lib
Replace processutils and lockutils modules of oslo-incubator with
oslo.concurrency lib.

Change-Id: Ic1af8753a70f1aada22efe8132e48cbc16e14f3f
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
2014-12-17 13:20:54 +08:00
Oleksii Chuprykov
868fd6e383 Run tests with default concurrency 0
Setting concurrency to 0 would enable Glance tests to be run using the
the total number of cores on the system rather than by a single one.

This would, by default, speed up the run time of tests for developers
who are not aware about it. Also, any jobs which run these tests for
Continuous Integration would be benefitted without having to deal with
the machine level logic.

Closes-Bug: #1368274

Change-Id: I0842b0c0be1272d479fad9ef7609cd8a29231cb5
2014-09-30 11:37:02 +00:00
Andreas Jaeger
9777660809 Fix Jenkins translation jobs
The job glance-propose-translation-update
does not update from
transifex since our po files contain duplicate entries where
obsolete entries duplicate normal entries.

Remove all obsolete entries to fix the job.

Add test to pep8 that checks that no new breakages get
introduced.

Change-Id: I1bae1c1bf27bf664b24cf75fc96efb0fcfddc392
Closes-Bug: #1299349
2014-04-03 20:13:12 +02:00
Zhi Yan Liu
d7f1221684 Switch to testrepository for running tests
OpenStack as a whole is moving towards using testrepository and
testtools for running tests. To that end, bring Glance into line by
switching it to use testrepository to run tests.

This copies run_tests.sh and tools/colorizer.py from Nova.

This change also has some minor changes to make run_test.sh work well.

Partial fixes bug: 1179009
Fixes bug: 1271806

Change-Id: Ic265bc0d2f1528358f6e8ee5b4139f991923fc72
Signed-off-by: Steve Kowalik <steven@wedontsleep.org>
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
2014-01-29 08:30:55 +08:00
Kui Shi
fe897c0b79 emit warning while running flake8 without virtual env
run_tests.sh -N -p

it will call the flake8 installed on your host to detect PEP8, and
the flake8 plugin "OpenStack hacking" may not installed on your
host, so this command may not detect the OpenStack Style Commandment
supplied by hacking(e.g H202).

run_tests.sh -p
it will call the flake8 from virtual env, flake8 plugin "OpenStack
hacking" installed in virtual env will be triggered.

The result from "run_tests.sh -p" should be trusted, and jenkins uses
virtual env to run flake8 too.

When "-N" is enabled, emit warning to stderr to remind user.

Bug #1215396

Change-Id: Iac6be532b7b9bb911b745712712d1be363e8ff01
2013-08-28 07:07:29 +08:00
Jenkins
ef5d11d4d8 Merge "remove flake8 option in run_tests.sh" 2013-08-25 12:10:48 +00:00
Kui Shi
63f7995c07 remove flake8 option in run_tests.sh
flake8 read [flake8] section of tox.ini as options.

function run_flake8 in run_tests.sh should be kept simple,
and tox.ini controls the behavior of flake8.

Fixes Bug #1212988

Change-Id: I35d434ccea1ca2f3ff93657e4ca6dde93bbbf29e
2013-08-16 06:53:46 +08:00
Kun Huang
485274433f Text formatting changes
These are some text fixes in document, scripts and functions,
including variable usage, text aligning, adding new store class in
document

Change-Id: I98e226969d86698972870a7b3a042cb00c2206e9
2013-08-07 13:15:27 +08:00
Monty Taylor
66b3e5ec83 Use flake8/hacking instead of pep8.
Change-Id: Ia99bc9116d7d8b558002b302cafe354d05d57f72
2013-05-03 11:28:22 -04:00
John Bresnahan
039f3d8a59 Convert scripts to entry points
The executable programs used by Glance have historically been scripts
in the ./bin directory.  This patch converts all of the scripts to
entry_points.  This change makes these programs python modules.  Thus
they can be imported and methods in them can be called just like any
other module.  This will allow the tests to call into these programs
directly instead of having to fork out a process.

The conf.py file in the doc tree was causing a name collision with
the python module cmd.  The glance/glance directory was being added
to sys.path which made glance.cmd import with the name cmd.  This
patch also fixes that problem.

blueprint: refactoring-better-faster-stronger-functional-tests
Change-Id: I67ae14b7403af31a5944befcd2ec27a690e81f15
2013-04-29 14:08:29 -10:00
Matthew Treinish
9db0f051bd 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: I808f019de688387b14bc7a43eea4e45b05948e6b
2013-02-15 15:52:41 -05:00
Dan Prince
b8b3aa407e Add pep8 ignore options to run_tests.sh
Updates run_tests.sh so it uses the same pep8 ignore options
we do for tox. This fixes a slew of pep8 errors that will occur
with recent pep8 releases using Glance.

Change-Id: I0a9bb237f75eb307ee433cc6b1c5f78cd71dd02e
2012-11-25 21:22:10 -05:00
Joshua Harlow
5018ebfdc9 Allow for not running pep8.
Its not always wanted to run pep8 so we should have
a flag that can be used to disable it so that people
who do not want to run it can accomplish this.

Fixes: bug 1080907

Change-Id: I7f9dedbc7eca8421e0acf58e478c105f8b8de0c9
2012-11-19 16:08:59 -08:00
Dan Prince
6e99270283 Make run_tests.sh run pep8 checks on bin.
This updates the pep8 checks in our run_tests.sh script
so that we are scanning the bin directory.

Change-Id: I0ad51b7747edbcb0dbcfb72f92a43dd8f2efc768
2012-11-09 14:12:40 -05:00
Gerardo Porras
b075e90c8d Add noseopts and replace noseargs where needed to run_test.sh
Add of noseopts to the run_tests script so users can be
able to run tests adding extra options to be passed to
nosetests.
This option is currently in keystone but not in glance.
Fixes bug 1065758

Change-Id: I7c78749adb90b126da5bd9580da6bfd7c9e1bf54
2012-10-18 14:07:38 -07:00
Dan Prince
ede120a32d Updates run_tests.sh to exclude openstack-common.
We exclude openstack-common in tox.ini already. This change updates
run_tests.sh to match that behaviour.

Change-Id: I1bf5784193e63156bc5fe140ad6e403669c7909d
2012-07-13 14:10:56 -04:00
Alex Meade
0c0fd6acaa Clean up .pyc files before running tests.
Fixes bug 1015181

Change-Id: I5628de56464f882f804522c66d9ffbe35a3b21e1
2012-06-19 12:07:12 -04:00
Monty Taylor
de2a8a8d94 Clean up a few ugly bits from the testing patch.
The pep8 runner in run_tests.sh was still referencing run_tests.py
which no longer exists. Replaced that section with one that runs
pep8 the same way as tox.

Additionally, the first attempt at getting the test runner to do the
same thing with debug logging as run_tests.sh was doing became a bit
spammy. For now, actually have logging write out the log file in the
first place. Eventually, it would be nice to get this to properly
get spit out in such a way that nosetests would grab it and include
it in the failed test case output.

Change-Id: Ib5222a0c3507d5d7ede4d303c98323a622705301
2012-06-07 10:38:11 -04:00
Monty Taylor
898e732bd7 Just use pure nosetests.
The test suite can be run now with pure nosetests + the openstack nose
plugin. There is no longer any need for the run_tests.py.

Change-Id: Iad89a2c1cc567ba10919a52166b3309edef20009
2012-06-04 15:29:26 -04:00
Eoghan Glynn
64ab035f96 Add -c|--coverage option to run_tests.sh
A convenience for generating coverage metrics. Might make it
more likely that developers will review the coverage stats more
often, to identify pre-existing blackspots and avoid proposing
under-tested new code.

Change-Id: Iecd10ec529dd6e93d18a6763bf36667402640881
2012-05-03 14:58:46 +01:00
Brian Waldon
28f0dd425f Simplify pep8 output to one line per violation
Change-Id: Ia1df3d1fbdd21b1b8884848d27c3a2a567b51943
2012-01-30 20:39:20 -08:00
James E. Blair
37fc2b00c0 Rename .glance-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: I7916783d863e5184bad8293c3aed5ba119e374a9
2011-12-05 13:09:22 -08:00
Monty Taylor
6eb2831459 Removed some cruft.
Removed builddeb.sh - we don't use it.
Removed a reference to pep8 skipping vcsversion due to bzr bug.
Updated sqlalchemy in the pip-requires to allow/use 0.7.1 or later to match
Nova installs.

Change-Id: I2da2b39efd0b1b192a490509a44cb1f641b86092
2011-11-16 03:01:56 -02:00
Justin Shepherd
22c3e412cd Fixes bug lp:821296
Fixed exclude-dir to point to glance/tests/functional, now --unittests-only runs properly.

Change-Id: I237225fb49f1f4a284682768e888a2e03585cdf9
2011-08-05 09:49:03 -05:00
Justin Shepherd
486deeabd6 Implemented @utils.skip_test, @utils.skip_unless and @utils.skip_if functionality in glance/test/utils.py. Added glance/tests/unit/test_skip_examples.py which contains example skip case usages.
Fixed issue where ./run_tests.sh would not execute pep8. Fixed couple of pep8 violations in test_skip_examples.py

Change-Id: Id6eaa8768b663b4638fbca0e3bdf72b74969150a
2011-08-04 11:39:14 -05:00
Soren Hansen
327f7525c0 Move tests under the glance namespace. 2011-08-03 00:10:52 +02:00
Justin Shepherd
ae980abbb6 Installed nose-exclude, ./run_tests.sh --unittests-only add '--exclude-dir=tests/functional' to NOSEARGS 2011-07-30 00:12:44 -05:00
Brian Waldon
23a1457db9 adding run_tests.sh -p 2011-07-27 17:06:01 -04:00
Dan Prince
5e35359d45 Update tests and .bzrignore to use tests.sqlite instead of glance.sqlite. 2011-04-20 14:08:04 -04:00
Rick Harris
19d9a5d991 Including tests/ in pep8 2011-02-05 01:40:39 -06:00
Rick Harris
fe363898ce Adds --sql-connection option 2011-02-01 19:29:50 +00:00
jaypipes@gmail.com
9e4d7c8b0d Make run_tests.sh return failure when pep8 returns fail, and fix the pep8 error in /bin/glance-upload 2011-01-23 12:18:48 -05:00
jaypipes@gmail.com
96eb80f589 PEP8 fixes in /glance/store/__init__.py
Also makes run_tests.sh automatically call pep8.
Pulls in Nova's run_tests.py wrapper for prettying
up output from nosetests...
2011-01-19 14:22:41 -05:00
jaypipes@gmail.com
d59d1f1ca1 Implements Parallax API call to register a new image
* Adds unit test for Parallax API controller
* Adds stubouts for glance.parallax.db.sqlalchemy.api calls
  regarding images
* Adds --logging-clear-handlers arg to nosetests in run_tests.sh to
  prevent extra output in running tests when tests complete successfully
2010-10-12 14:01:12 -04:00
jaypipes@gmail.com
63fe51eab5 First round of cleaning up the unittests. Adds test suite runner, support for virtualenv setup and library dependencies, resolves issues with ImportErrors on cloudfiles, adds pymox/stubout support and splits the backend testing into distinct unittest cases. 2010-10-08 16:42:13 -04:00