Commit Graph

55 Commits

Author SHA1 Message Date
Andreas Jaeger 08c07018dc Fix pep8 and py27, functional jobs
pyflake8 was updated and not properly constrainted by hacking, update
to hacking 3.1.0 and fix the problems found.

py27 failed since global upper-constraints includes py3 only packages.
Use lower-constraints for this test.

The functional jobs run on master with py27, remove the py27 master job,
change the jobs so that py3 is used everywhere.

Change-Id: I695d60e53857e03f206dcd7cf10c06c76c8d6cc0
2020-06-01 07:54:56 -05:00
Sean McGinnis 483a687188
Bump default tox env from py37 to py38
Python 3.8 is now our highest level supported python runtime.
This updates the default tox target environments to swap out
py37 for py38 to make sure local development testing is
covering this version.

This does not impact zuul jobs in any way, nor prevent local
tests against py37. It just changes the default if none is
explicitly provided.

Change-Id: Icac2af192beb9bd4a38b2305ebb6dc5719e4b591
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-24 10:26:03 -05:00
Sean McGinnis 3db89db8c6 Break out py27 job templates
To allow non-py27 supporting repos to use shade job templates, this
breaks out the py27 and py3 jobs into separate templates. Relevant repos
can then continue to use the existing template names without picking up
the unsupported job runtimes they no longer need.

Remove the py27-tips jobs - they just don't make any sense any more.

Change-Id: Ia211e31723ede592f19a8df6c18e45699ca25788
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-11 13:20:26 -05:00
Corey Bryant b0639aa94f Add Python 3 Train unit tests
This is a mechanically generated patch to ensure unit testing is in place
for all of the Tested Runtimes for Train.

See the Train python3-updates goal document for details:
https://governance.openstack.org/tc/goals/train/python3-updates.html

Change-Id: I96c9f4dc64b252bac3c934936c7eebe270862c9e
Story: #2005924
Task: #34233
2019-07-05 14:36:51 -04:00
Monty Taylor b47fb2af55 Update for opendev
Change-Id: I2cf0463108cf0bea37a221ee1dd74252d13f41c4
2019-04-21 13:00:42 +00:00
Jens Harbott bea73746c8 Fix ansible stable pin in tox test
We want to use the latest version from the stable-2.5 branch, not pin to
2.5.0 which has some issues that break our tests.

Change-Id: If7bab97191c5a29bac79e3f3ecaf10bfe0eac6b5
2018-12-20 12:54:23 +00:00
Nguyen Hai Truong 6904b010ac Add python 3.6 unit test job
This is a mechanically generated patch to add a unit test job running
under Python 3.6 as part of the python3-first goal.

See the python3-first goal document for details:
https://governance.openstack.org/tc/goals/stein/python3-first.html

Change-Id: I2060b317077a321fce27b6e92112233346e21687
2018-11-06 00:57:23 -08:00
Kim Bao Long 7d1b6bf198 Update the min version of tox to 2.0
The verification comands used by tox need at least 2.0 version. This
patch aims to update tox version from 1.6 to 2.0 which should help with
local running of constraints targets.

Change-Id: I97ec363926b6e6af26ffb650ced568c7df1f9897
2018-11-02 08:30:48 +00:00
Doug Hellmann c12ebc16e8 fix tox python3 overrides
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.

We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.

We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.

Change-Id: I972721cf714d811a427ee6a860b0c18c9920c8bc
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-06 15:27:01 -04:00
Monty Taylor 949982c780
Update ansible test job to run against stable-2.5
ansible now depends on openstacksdk and not shade. Update the shade
tests to test against stable-2.5 branch so that we can make sure shade
patches don't break people using older ansible.

Change-Id: Id7af93cbc73b208d7a973ca5101b8977a0ace689
2018-05-27 08:48:00 -05:00
Monty Taylor dcbcfbf124
Fix recent pep8 issues
The latest version of pycodestyle got stricter with undefined objects
pulled in via * imports. It's a nice check and actually found a bug, so
instead of disabling it, fix the places where we're using a * import.

W503 on the other hand is terrible.

Change-Id: Id73599ca494545b0f6d2345236190fc13cf2a326
2018-05-12 10:31:30 -05:00
Doug Hellmann 8f99e6e3e9 add lower-constraints job
Create a tox environment for running the unit tests against the lower
bounds of the dependencies.

Create a lower-constraints.txt to be used to enforce the lower bounds
in those tests.

Add openstack-tox-lower-constraints job to the zuul configuration.

See http://lists.openstack.org/pipermail/openstack-dev/2018-March/128352.html
for more details.

Fix the lower-bound for requests-mock, since 1.1.0 does not actually
work.

Change-Id: I8740a80c64e24c8339ee9b0992c2f81b1784e672
Depends-On: https://review.openstack.org/555034
Depends-On: https://review.openstack.org/555402
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-04-06 01:27:16 -04:00
Monty Taylor 52d7d845b4 Shift doc requirements to doc/requirements.txt
This is the new hotness.

Add doc8 linting to the pep8 target while we're doing it. And, slim down
pep8 tox env. It doesn't need to install shade or any of the
requirements.

Change-Id: I1e73ee503c81f92b4fe84bdd384f856290b6d5dd
2018-01-24 16:03:05 +00:00
Monty Taylor d69288b1a2
List ansible/ansible in required-projects
The ansible-devel functional test intends to run against tip of ansible
devel. Let Zuul handle that and depends-on once cross-source depends
exist by listing ansible/ansible as a required-project.

Remove the special install handling, as tox-install-siblings should be
taking care of it now.

Change-Id: I93459ffc116f9106d9eb8000a7e5a58bea507308
Depends-On: Ib5e35315fc9ffe6fa8873ad4975309d9820e1feb
Depends-On: I6d234247e3d45befd264e159c8b0fe77f01c7fdc
2018-01-08 18:24:25 -06:00
Tony Breeds 386176d77d
Avoid tox_install.sh for constraints support
I created a tox PR[1] to add native support for constraints.  The answer
was basically "use deps".

I tested it locally with shade and tox and it does indeed seem to do
what we want.  Use shade as a guinea pig before rolling this out wider.

[1] https://github.com/tox-dev/tox/pull/642

Change-Id: I450dd513d7e1f881db764b11dcd6f9072c0c369c
Depends-On: Id61ae52d48b28cfc2221cb556a1c1f7c6dfd60dd
2017-11-29 15:37:16 -06:00
Monty Taylor 24384e1599
Fix basepython setting in tox.ini
Noticed this for real in openstacksdk. This line is causing python3
tests to not run under python3.

Change-Id: I1ac6396a28ae308f778cabd7d5bc399262772d21
2017-11-29 12:06:59 -06:00
Matthew Treinish 73ef1f549c
Switch to using stestr
stestr is a fork of testrepository, designed specifically to concentrate
on being a dedicated test runner. [1] The testrepository project is
basically not active anymore and has several long standing bugs and
useablility issues. stestr is still actively maintained and fixes a
large number of those issues with testrepository.

[1] https://github.com/mtreinish/stestr

Change-Id: I9b8049fd2c78d8f90aed5a8b35c0a9b40ad8c463
2017-09-08 18:40:51 -05:00
Monty Taylor 469cc5ae49
Fix typo in tox.ini
Change-Id: I320460d9226f3f4dba782047f83466c0dbbd7e56
2017-09-01 08:13:22 -05:00
Monty Taylor 78a1aa3b93
Add tox_install.sh to deal with upper-constraints
shade is in global requirements and upper-constraints now, which means
we need to use the tox_install.sh script so that constraints don't break
install of shade itself.

Change-Id: Id286b634046519e34ac2c01461391d5bc61cd919
2017-08-31 15:45:20 -05:00
Jenkins ffe86e5ba5 Merge "Add debug to tox environment" 2017-07-26 13:19:57 +00:00
Paul Belanger f66f862073
Initial commit of zuulv3 jobs
Here we are adding shade to zuulv3.o.o to aid in testing.

Add UPPER_CONSTRAINTS_FILE to tox whitelist of variables.

Change-Id: I4bc3bd751a80308df3b2114f95886bd104516dd2
Depends-On: Ib9f0a787998f34414c8072074113d29cdb8cdb59
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-07-25 13:49:26 -04:00
Lee Yarwood a9687a82fc Add debug to tox environment
The oslotest package distributes a shell file that may be used to assist
in debugging python code. The shell file uses testtools, and supports
debugging with pdb.

To enable debugging, run tox with the debug environment. Below are the
following ways to run it.

* tox -e debug module
* tox -e debug module.test_class
* tox -e debug module.test_class.test_method

Change-Id: If0b06dcf094682401c4b09dd72493c678ea2a6b0
2017-07-10 15:03:01 +01:00
deepakmourya 19cddb5591 Remove py34 and pypy in tox
No gate check for py34 and pypy

Change-Id: Idcc0dd485d94ab66e52e086c6d5cda268c5aea07
2017-06-14 11:56:16 +05:30
Monty Taylor 329b939241
Add ability to run any tox env in python3
To test this I ran the pep8 tox env with python3 set - and lo and behold
there was a python3 mistake in a functional test. Whoops.

Change-Id: Ia93a2a85e420d164d67abee479ad498b5e6d3167
2017-05-19 12:39:21 -05:00
Monty Taylor a88d41e302
Fix tips jobs and convert Nova Floating IP calls
The script to install the git versions of the libraries wasn't working
because it wasn't installing over top of the versions already installed
by pip. So by adding an uninstall first, we ensure that the git version
is actually installed.

Also, add a pbr freeze to the end so that we can verify, and some +x so
that we can see the output of our scripts.

And: novaclient 8.0 doesn't have these calls anymore. However, the tests we
had on legacy clouds were erroneously installing the wrong version of
novaclient so we did not catch it. Doh. This has to do the tests and the
calls in the same patch because the fix to the gate job to install the
correct verison of the library exposed the fact that we had be broken
for these for a few minutes.

Depends-On: I208e8c009d0438de19cd3eb08dc45ddebb45d3e9
Change-Id: I4fd882aeb8373b94c7f6b54d97b457042b324361
2017-05-15 17:05:35 -05:00
Jenkins 7333bc7ae4 Merge "Update tox build settings" 2017-03-30 18:04:59 +00:00
Monty Taylor bb4eededb0
Update tox build settings
Remove heatclient and magnumclient from install-tips

We do not consume them anymore, so do not need to install them as part
of our tips testing.

Install from pip using upper-constraints. To ensure we work with
OpenStack releases.

Change-Id: I98f39d2e2a591eb84a1ebcd033eb51e1758f1f39
2017-03-29 05:13:49 -05:00
Monty Taylor b447fa4356
Take care of multiple imports and update explanation
The explanation for what's up with pep8 checks is a little different
than it used to be. Get it up to current.

Change-Id: I2c03a5aec02dd41ed5cdfb4c4082e17339ed2765
2017-03-29 04:29:48 -05:00
Monty Taylor b34e06f81b
Reenable hacking tests that already pass
Several of the ignores are things we're already clean on. Just reenable
them.

Change-Id: Ic6ac2123ca2574a089aa2882f84cf0d4a9d47b1e
2017-03-29 04:29:18 -05:00
Monty Taylor 7ac3c03212
Enable H201 - don't throw bare exceptions
I agree - bare except is bad - it can cause ctrl-c to stop working,
which is totally evil. (I mean, unless that is the intent, in which case
it's the right thing to do. None of these cases are cases when we desire
ctrl-c to stop working)

Change-Id: Ieffa26e8da77199c9ef7238a6c9f0704fc581ba6
2017-03-29 04:23:02 -05:00
Monty Taylor fe130c620b
Enable H238 - classes should be subclasses of object
As shade is no longer an Infra project, it's no longer appropriate to
ignore hacking. Luckily, shade is mostly hacking clean anyway, so this
isn't terribly disruptive.

Change-Id: I607f1835abb328e3b4a4a33d80a1848ab11779be
2017-03-29 04:22:22 -05:00
Monty Taylor c9e9ef9f43
Fix a few minor annoyances that snuck in
We had the normal infra pep8 ignores marked, but follow some of them by hand
in this codebase anyway. While E12* are not valid pep8, the prevailing style
of shade is in agreement with them. While we weren't enforcing them, a few
instances snuck in. Fix them and just turn the flags on.

Change-Id: Iea2bd9a99eb8b20dd40418ac8479b809d3872de8
2017-03-29 04:16:39 -05:00
Doug Hellmann d79de9b860 add separate releasenotes build
Add the sphinx files needed for a separate release notes document build.

Change-Id: I176e70614051e0d830fb59b05da2248bd484e57a
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-03-16 13:55:57 -04:00
Monty Taylor cf2d350027
Add helper script to install branch tips
shade has a functional test that intends to test shade against the
current tip of client libs. Unfortunately, what it's really doing is
installing latest release of the library into the shade virtualenv
that's used for functional testing and using tip of library for the
OpenStack install.

This is not a combo we care about.

Instead, install the library tips into the virtualenv. To do this, make
a functional-tips venv for tox, and make the post_test_hook optionally
use it.

Change-Id: Ibac2982e88439362c7af933c3a07c4d581ee6f2b
2017-01-18 16:55:23 -06:00
Jordan Pittier 5a54765cb5 Tox: optimize the `docs` target
No need to install runtime dependencies nor to actually install
Shade in order to generate the documentation. So just don't.

This speeds up a bit the doc generation.

Change-Id: I2264cfbcb53171b345e1a923111c48d2d063f757
2016-12-07 12:28:26 +01:00
Jamie Lennox ecb317d610 Allow setting env variables for functional options
The shade functional tests are hardcoded to use the cloud configuration
that is typically provided by devstack. It turns out that shade
functional tests are a useful way to quickly test that a cloud is up and
configured.

Allow providing new values for flavor, image and cloud variables so that
the functional tests can be run on a non-devstack cloud.

Change-Id: I90ab125be77091eaf16ae16e47f4336d4ef49880
2016-10-20 14:28:42 +11:00
Jordan Pittier db4bace474 List py35 in the default tox env list
We really should run py35 tests when we run "tox" without any
arguments.

I0d6c8c8255717770c7e3297bfe5d6130e983d5b0 is going to make
the py35 job voting.

Change-Id: I8c9b459dfaf1e29e7e8321bfd34061d3d2ad5249
2016-10-04 19:02:50 +02:00
Monty Taylor ae705ec878
Change deprecated assertEquals to assertEqual
It literally doesn't matter, but also getting deprecation warnings is
equally silly. Change the deprecated things to the non-deprecated one,
and then enable the check that prevents this from happening in the first
place.

Change-Id: Icd714da7ee881fad0c201e9cd56b32a4a330a431
2016-08-21 15:40:42 -05:00
Monty Taylor 3462561c46
Only run flake8 on shade directory
I frequently have random test files and virtualenvs scattered in my
working directory, so tox -epep8 gets frustrating. We don't have any
files that need to be linted that are not in the shade directory - so
go ahead and explicitly limit the invocation.

Change-Id: I16d8f477ae08a1e54724991ccf4a169ae3b35369
2016-08-21 11:17:56 -05:00
Yolanda Robla 5f5c925631 Use keystoneauth.betamax for shade mocks
Instead of mocking the clients, use keystoneauth1.betamax
fixture to intercept keystoneauth.construct_session, and provide
our own recorded fixtures.

Change-Id: I7b2973b0f89b66c19d6bf10571c3c93692107aa3
2016-06-10 08:11:01 +02:00
David Shrewsbury df379be704 Add docs tox target
Add a tox target to easily build the shade documentation.

Change-Id: I38f3a39de1a34ae8709ce3b83a8fb51dd75299d3
2016-02-12 03:43:57 +00:00
David Shrewsbury 9d7229f65b Allow specifying cloud name to ansible tests
It would be *really* cool and useful and stuff to be able to run
the Ansible playbooks against more than just devstack. This change
allows that. Now you can send the -c option to the tox command line:

    tox -e ansible -- -c coolcloud

Or, specific tests:

    tox -e ansible -- -c coolcloud auth network

Going against devstack is still:

    tox -e ansible
    tox -e ansible auth network

Change-Id: I666a09aee3d283865c3813d67edfb75123057c22
2015-11-21 14:27:54 +00:00
David Shrewsbury 1ac8530c25 Add ability to selectively run ansible tests
Now that the Ansible module tests can be run via tox, it
might be nice to allow developers the ability to selectively
run individual module tests (accomplished via Ansible tags) from
tox.

Change-Id: I38a3040a7157a9bcf1cda76e26ab11577e9f80a6
2015-11-12 15:59:45 -05:00
David Shrewsbury cb0e9130f5 Add Ansible testing infrastructure
The keypair test needed adjusting so that it would work in
the gating environment, and anywhere an SSH key may not be
available.

Change-Id: Ic9bf41c2b4041911d05217ad3748e097326bac3a
2015-11-11 17:00:33 -05:00
Monty Taylor 5a420350db Return IPv6 address for interface_ip on request
If the local host looks like it can route IPv6 and we have an IPv6
address, and the user has not indicated that they must use IPv4 for
some reason, return it to them in the interface_ip field.  Also, always
return something in interface_ip if possible.

Change-Id: I3544280cab7abfa6b4154244f4c4588bc65c7347
Depends-On: Ib0c4c4e8b3b7b4bcee5fa3414719969274929b9a
Co-Authored-By: James E. Blair <jeblair@linux.vnet.ibm.com>
2015-10-02 11:07:28 -04:00
James E. Blair d5d539da81 Remove hacking select line
Contrary to popular belief, this does not mean "also check this".
It means "only check this and don't check anything else".  So this
was testing _only_ H321.

Change-Id: I8ae173e62d57232cec1bf751004fe4213214353b
2015-06-03 18:55:58 -04:00
Clint Byrum 5af9a9d198 Pass OS_ variables through to functional tests
tox 2.0 isolates tests from environment variables by default now.

Once devstack emits clouds.yaml we can remove this and consume that.

Change-Id: I8e8c769bbdb3f467af0802e1d49f5ebd84663a8f
2015-05-14 10:34:52 -07:00
Monty Taylor 7cb9d2b46e Clean up race condition in functional tests
This could all be made much fancier - but in general, for now, kill
concurrency until we can get much richer isolation put in - and make
sure that we're only cleaning up servers that we created in the test.

Change-Id: Iea341076f55f41573ee2bb0f378c8602d21b39a2
2015-03-16 12:27:24 -04:00
Ricardo Carrillo Cruz 738d215661 Add initial compute functional tests to Shade
Also, modified tox.ini to add a 'functional' stanza and
the testenv now runs only unit tests.

Change-Id: Id8a1193c829f7f3ab764c334b1f796f19f447fdd
Depends-On: I1cf58e6a4cf728c5d2a32d602d9dfae1d4dfd62c
2015-03-13 13:40:46 +00:00
Ricardo Carrillo Cruz 1d0e7fdc72 Reorder envlist to avoid the rm -fr .testrepository when running tox -epy34
Change-Id: Ibe34867caf97e05bc13614b3c685e8cfb0d6220a
2015-02-26 17:08:56 +00:00