52 Commits

Author SHA1 Message Date
Eric Brown
73c2a809f7 Remove py34 tox env and pypi classifier
Currently only py27 and py35 (not py34) is tested in the gate, so
py34 should no longer be part of the tox environment or part of the
PyPi classifier.

Change-Id: I155fc0e3ac06b495718d9fa3058edded738cb011
2017-03-07 14:40:27 -08:00
Rui Chen
fd0ac815de Functional tests debug support
Pass OS_* options into tox debug venv in order to
debug functional tests in local, and install ipdb
to make code-debug more convenient.

Change-Id: Ib926948f2b9a52921cf7487fe16ef716481e3ceb
2017-01-22 06:30:15 +00:00
Monty Taylor
63cdf079b1 Use git+file urls instead of directories
The /opt/stack/new directories are owned by the wrong user, so python
setup.py egg_info fails because it can't create the egg_info dir.
Changing the invocation to use git+file:// urls solves the problem.

Additionally, make a correction to test collection.

Change-Id: I39da0b26417dce1a72b15dedc02d10284329307f
2017-01-14 20:40:17 +00:00
Monty Taylor
64385002ea Install from /opt/stack/new instead of git.o.o
Installing directly from the git url will bypass any depends-on
processing zuul may have done on the dependent repos.

Change-Id: I3dadacf7a855cc4efad701f0a6275d6cd60efd72
2017-01-13 02:29:38 +00:00
Steve Martinelli
d98b72c245 add support for running tests with master dependencies
we can create a new infra job that points to the new test hook,
which should install the master version of the SDK, osc-lib
and os-client-config.

Change-Id: Ib6391893b2302bdc514525d5ddda886fe8c60100
2017-01-11 18:56:07 +00:00
Steve Martinelli
c14d3efe61 move all functional tests to tests module
functional tests should be grouped with other tests (unit and
integration tests). as part of this commit the "common" module
was renamed to just "base", this was done for simplicity.

the post_test_hook.sh file was also copied to the functional module
since it should live there. a separate change to the infra repo
will be made to call the new location, once that is merged we
can remove the old one (a new change will also be posted for that)

Needed-By: I49d54f009021d65c1ae49faf6b3f0a7acdadd7b3
Change-Id: Ie8c334f6223373b8e06df8bd8466500d2a2c8ede
2016-09-09 03:29:47 +00:00
Dean Troyer
2a1a174086 Gate-unbreaking combo review
Fix argument precedence hack
  Working around issues in os-client-config <= 1.18.0

  This is ugly because the issues in o-c-c 1.19.1 run even deeper
  than in 1.18.0, so we're going to use 1.19.0 get_one_cloud() that
  is known to work for OSC and fix o-c-c with an axe.

Remove return values for set commands
  'identity provider set' and 'service provider set' were still
  returning their show-like data, this is a fail for set commands
  now, don't know how this ever passed before...

Constraints are ready to be used for tox.ini
  Per email[1] from Andreas, we don't need to hack at install_command
  any longer.

  [1] http://openstack.markmail.org/thread/a4l7tokbotwqvuoh

Co-authorioed-by: Steve Martinelli <s.martinelli@gmail.com>
Depends-On: I49313dc7d4f44ec897de7a375f25b7ed864226f1
Change-Id: I426548376fc7d3cdb36501310dafd8c44d22ae30
2016-08-18 07:21:15 -05:00
Huanxuan Ao
ab32f37e67 Remove an outdated directory in tox.ini
The directory openstack/common from the exclude list of
flake8 in tox.ini was used to keep codes from oslo-incubator,
but oslo-incubator was retired, so don't use this directory
any more.

Change-Id: If1ea5dc167cfe4a09aad413b9eab0af807ebe603
2016-08-03 13:44:05 +08:00
Steve Martinelli
e2a9fd29c1 Follow upper constraints for all tox targets
With the exception of releasenotes and cover, we should follow
upper constraints. The tox_install file was copied over from
python-neutronclient [1].

[1] http://git.openstack.org/cgit/openstack/python-neutronclient/tree/tools/tox_install.sh

Change-Id: I633fa149820efafd7b2acec0388fa8bc8d06c988
2016-07-17 17:01:52 +00:00
zheng yin
e40e1f6990 Add Python3.5 to setup.cfg tox.ini
Now that there is a passing gate job, we can claim support for Python 3.5
in the classifier. This patch also adds the convenience py35 venv.

Change-Id: If93af96739741584c87913ba140d0c6cee2aa10d
2016-07-12 07:20:08 +08:00
Sheel Rana
095edbc367 Pep8 environment to run on delta code only
Currently tox -epep8 will run flake8 on whole code.
To make this fast, flake8 support is added for only
updated(delta) code.

Same can be run by "tox -efast8".

Change-Id: I9c55fed32ae3060c21ec278398e9e07fb4a0fe13
Implements: BP tox-pep8-diff-part-only
2016-05-12 00:55:10 +05:30
Michael McCune
505659b0aa add a bandit environment to tox
This change is being proposed as part of the OpenStack Security Project
working session at the Austin 2016 summit. It adds support for running
the bandit[1] security linting tool against the python-openstackclient
codebase. This change adds a targetted environment for bandit and also
adds bandit as part of the pep8 job.

The bandit configuration has been tailored to exclude tests that are
currently producing warning against the codebase. These issues will be
followed up with bug reports and patches.

[1]: https://wiki.openstack.org/wiki/Security/Projects/Bandit

Depends-On: Iccd81c17e84df03d249c1012277dad9cb68c5845
Change-Id: I691829c1224557d1d239c9f665ac539d0f13c4d3
2016-04-28 14:52:33 -04:00
Jenkins
277c16c8b7 Merge "Defaults are ignored with flake8" 2016-02-26 01:59:47 +00:00
ting.wang
3e08590600 Improve tox to show coverage report on same window
With this patch coverage report will be shown with the results when
tox -e cover will be run.

Change-Id: I96713a8dd5d82019631c9e48c1abd7a94e201569
2016-02-24 10:44:06 +08:00
Tom Cocozzello
3d7a26bdec Defaults are ignored with flake8
If “ignore” is not set under flake8 in the tox.ini
file there there are defaults set to be ignored.

The depended patch fixes many of the problems.

Change-Id: Ieed2fe1c4654e201d3fe6d40ef93e247ee736f8b
Doc: http://flake8.readthedocs.org/en/latest/config.html#default
Depends-On: I935ab48e7c5bac5f88ecdb3a05f73fb44fc9f41d
Closes-Bug: #1548910
2016-02-23 11:08:36 -06:00
Ondřej Nový
0a132d3256 Deprecated tox -downloadcache option removed
Caching is enabled by default from pip version 6.0

More info:
https://testrun.org/tox/latest/config.html#confval-downloadcache=path
https://pip.pypa.io/en/stable/reference/pip_install/#caching

Change-Id: I521b7cb11374f0600d1f6d4c6529e95aa29654b0
2015-12-11 23:30:31 +01:00
Dean Troyer
afd1b489ff Add reno for release notes management
Change-Id: Iaaf3f9ca7cb431e41adfb2a052e01e2240a63a07
2015-12-02 14:32:07 -06:00
Steve Martinelli
510a4d9674 Remove py26 support
as of mitaka, the infra team won't have the resources available to
reasonably test py26, also the oslo team is dropping py26 support
from their libraries. sine we rely on oslo for a lot of our work,
and depend on infra for our CI, we should drop py26 support too.

Change-Id: I66d168ecc755a3ea0e01d5b6344d06d9e0d1378b
Closes-Bug: 1519510
2015-11-24 17:08:04 -05:00
TerryHowe
bc28adc62d Remove requirements.txt from tox.ini
From lifeless: pbr reflects the package dependencies from
requirements.txt into the sdist that tox builds.

Change-Id: I63548ec321b9c59cc935ba8179b1da5b9c90e09b
2015-07-17 11:21:02 -06:00
TerryHowe
922074b2d9 Drop py33 support for Liberty
Less is more:
https://wiki.openstack.org/wiki/Python3

Change-Id: I8a98b72f85bb29a3663c654613ac0d70fddbc1b1
2015-07-13 14:50:47 -06:00
Matthew Treinish
ae29f7f459 Use ostestr for test runs
This commit switches to use ostestr for running tests. ostestr
integrates the subunit-trace output that other projects use for test
output. (in addition to some other ui niceties)

Change-Id: Ib5b5225b2a7bfb7897e1efe55181389d1ae095cb
2015-05-29 11:31:15 -04:00
TerryHowe
d39b9c91c4 Fix functional test gate
The functional test gate seems to be broken.  The environment
variables are not being passed through.

Change-Id: Ied1f56877e4793c5e88e59d2afb7f1a5b3868560
2015-05-15 13:25:37 -06:00
TerryHowe
9561420a4f minor syntax error in tox.ini
Change-Id: I476ea8f2cf4370e62b6b6b15d72b97beabe6677e
2015-05-01 12:40:46 -06:00
Jenkins
075987267b Merge "Functional tests run in many environments" 2015-04-29 05:53:09 +00:00
TerryHowe
aa7e58cefb Functional tests run in many environments
Have the functional tests running with less customization and
less shell.  This change will allow the functional tests to be
run against any cloud set up in the environment.

Change-Id: I24f621fbace62273e5a0be24e7af9078c0fc8550
2015-04-25 08:42:06 -06:00
Steve Martinelli
d6fa242818 Remove references to venv
Stick to using tox, remove the tools directory since it only
contained references to using venv. Also update a few other
locations that would have otherwise been incorrect.

Change-Id: I7d3e9067256ac0935f07904abcf584d898ac1d6f
2015-04-24 02:15:36 -04:00
Terry Howe
d843255bd8 Change test order to avoid incompatibliity
If py26 or py27 tests are run first, there is a incompatibility in
the .testrepository that breaks several tests.  To get around this,
you need to run the py33 tests first.  This change was made over in
the cliff project.

Before:
    (.venv)terry@brat:~/cli$ rm -rf .testrepository/
    (.venv)terry@brat:~/cli$ tox
      ...
      py26: commands succeeded
      py27: commands succeeded
    ERROR:   py33: commands failed
    ERROR:   py34: commands failed
      pep8: commands succeeded
After:
    (.venv)terry@brat:~/cli$ rm -rf .testrepository/
    (.venv)terry@brat:~/cli$ tox
      ...
      py33: commands succeeded
      py34: commands succeeded
      py26: commands succeeded
      py27: commands succeeded
      pep8: commands succeeded
      congratulations :)
    (.venv)terry@brat:~/cli$

Change-Id: Ie1717efd6827eae36683f2e7fe7ff8ec58ff4aa8
2015-01-28 05:44:37 -07:00
Steve Martinelli
703a25d445 Remove ignore portion of tox.ini
In the latest hacking update a few rules were dropped, and we no
longer have to ignore these rules in our tox.ini.

Change-Id: Id38a1497019c7fe2d4ad8567f1c0c8d229951751
2015-01-26 00:21:06 +00:00
Oleksii Chuprykov
ab89ef5876 Tests work fine with random PYTHONHASHSEED
Change-Id: Iba6fc87bbff289ae2572a7eb132f5c946dfa0956
Related-Bug: #1348818
2014-11-12 15:55:39 +02:00
Steve Martinelli
e7bba3211a Include support for using oslo debugger in tests
Simply run `tox -e debug <test_name>` to get an interactive
debugging prompt

Change-Id: I09e5b844a33c2f0fd4230f01fbc6c0aa8d752545
2014-10-22 14:29:36 -04:00
Jenkins
89a58c65ca Merge "Add functional tests to osc" 2014-10-03 22:38:01 +00:00
Steve Martinelli
1934b1b243 Place the command to generate docs on one line
Change-Id: I99d78208c940bc6646327ee967e71187c32a159f
2014-10-03 00:09:59 -04:00
Steve Martinelli
742982af4b Add functional tests to osc
Create a script that kicks off function tests that exercise
openstackclient commands against a cloud.

If no keystone/openstack process is detected, a devstack instance
is spun up and the tests are run against that.

There is also a hook added to tox.ini so that we can run these
tests easily from a gate job.

Change-Id: I3cc8b2b800de7ca74af506d2c7e8ee481fa985f0
2014-10-01 19:46:07 -04:00
Jeremy Stanley
181166f81b Work toward Python 3.4 support and testing
Change-Id: I70d8cf0971d18b9b2eb967e28cedecc897721f58
2014-09-03 19:05:47 +00:00
Dean Troyer
f3dbab4a6c Fix PEP8 E302 errors
Also add remaining skipped checks to HACKING

Change-Id: I0c4333ce29597e0a8a233af17c15bed2b4d0711f
2014-07-22 17:51:15 -06:00
Cyril Roelandt
3cfb97e5ae Add Python 3 support
Change-Id: I65fabfc4788230b7280808ec912601c327095db0
2014-07-15 10:26:16 +02:00
Dean Troyer
4914a8d107 Fix PEP8 E126 and E202 errors
Do both as they are all in the same set of files that required
major re-formatting.

Change-Id: I6e8a8ce19a55105124a33c0e2487fc4b4e06d252
2014-06-27 09:12:55 -05:00
Dean Troyer
11f3654f6e Fix PEP8 E265 errors
Change-Id: Ieb9a9af1da27d3935d1a4d3cfb61b0ccb03d099a
2014-06-27 09:12:55 -05:00
Dean Troyer
a78d75f290 Fix PEP8 H405 errors
Change-Id: Id9ea03e7d88148f84bffe1b18b5b4315e6123012
2014-06-27 09:12:38 -05:00
Steve Martinelli
89cbdd1ae1 Add a docs job to tox.ini
A noticed that there wasn't a docs option when running tox.
Thought it would be a good idea to add one.

Partial-Bug: #1331304
Change-Id: I5af9ff5d5986ad546146c0fa73eb98256fd00c5f
2014-06-18 03:41:42 +00:00
Dean Troyer
0059f045a9 Ignore most of the new hacking 0.9.2 rules
So we can update requriements.txt.  But fix a couple of easy ones:
* Fix E251 (1 occurrance)
* Fix E131 (1 occurrance)

Change-Id: I62aaa423aa6da9e9f0ca026ec586b51cc6a6df03
2014-06-13 17:06:28 -05:00
Jeremy Stanley
380d78c856 Remove tox locale overrides
* tox.ini: The LANG, LANGUAGE and LC_ALL environment overrides were
introduced originally during the testr migration in an attempt to be
conservative about the possibility that locale settings in the
calling environment could cause consistency problems for test runs.
In actuality, this should be unnecessary and any place where it does
cause issues ought to be considered an actual bug. Also, having
these in the configuration actively causes older pip to have
problems with non-ASCII content in some package metadata files under
Python 3, so drop it now.

Change-Id: I89ff5c22be053f09defb04b3ec589d74bffcae9d
Closes-Bug: #1277495
2014-02-10 03:10:52 +00:00
Dean Troyer
c8723ce175 Update tox.ini for new tox 1.6 config
Change-Id: I4363508f562f62b16c856bc072cdb4b37e37b418
2013-09-04 14:23:15 -05:00
Dean Troyer
17f13f7bf4 Create a new base REST API interface
* restapi module provides basic REST API support
  * uses dicts rather than Resource classes
  * JSON serialization/deserialization
  * log requests in 'curl' format
  * basic API boilerplate for create/delete/list/set/show verbs
* ignore H302 due to urllib import

Change-Id: I3cb91e44e631ee19e9f5dea19b6bac5d599d19ce
2013-08-23 12:08:32 -05:00
Chuck Short
7183a11f09 python3: Introduce py33 to tox.ini
Introduce py33 to tox.ini to make testing with
python3 easier.

Change-Id: I7a775ac51e0bc0a5929184af47d51ea1cc4e3219
Signed-off-by: Chuck Short <chuck.short@canonical.com>
2013-06-01 19:58:34 -05:00
Zhenguo Niu
bac0718764 Rename requires files to standard names.
Rename tools/pip-requires to requirements.txt and tools/test-requires
to test-requirements.txt. These are standard files, and tools in the
general world are growing intelligence about them.

Change-Id: I903213fda94a833335abaa7ad9a90bbb688ec15a
Fixes: bug #1179008
2013-05-29 17:38:13 +08:00
Monty Taylor
967d929207 Migrate to flake8.
Fixes bug 1172444

Change-Id: Ieca721663aea2fd31753df4abfb5b01a7145b26a
2013-05-16 10:36:02 -07:00
Dean Troyer
73fb88e931 Make entry point strings readable
PEP8 E126 wants continued strings to line up vertically, totally destroying the
readability and visual indication of the beginning of a string in a list

* Ignore PEP8 E126 in order to indent the entry point strings in a readable manner.
* Sort the enrty point command strings by object then verb.
* Bring other ignores from run_tests.sh to tox.ini

Change-Id: I2593de7d6c058322101bc68636317cdba29fe664
2013-03-21 21:51:08 -05:00
Josh Kearney
b26cb5bf68 Upgraded to PEP8 1.3.3 to stay aligned with Nova, etc.
Made all the necessary changes to pass new PEP8 standards.

Also cleaned up docstrings to conform to the HACKING stanards.

Change-Id: Ib8df3030da7a7885655689ab5da0717748c9edbe
2013-01-31 13:31:41 -06:00
Josh Kearney
63c8bb5306 Migrate from nose to testr.
Run tests with testr for parallel execution.

Part of blueprint grizzly-testtools.

Change-Id: I560592186f2f440049a451a32e58067262ab62d0
2013-01-22 12:16:09 -06:00