Commit Graph

147 Commits

Author SHA1 Message Date
Stephen Finucane 568921ce5b tox: Correct functional test factors
We are running functional tests in zuul without a 'pyNN' factor (e.g.
'tox -e functional'). For this to work, we need to allow an empty
factor, i.e. we want:

  [testenv:functional{,-py310}]

rather than:

  [testenv:functional{-py310}]

(note the missing comma)

Unfortunately we missed this as tox 4 has a currently unaddressed
regression [1] that results in it running the base testenv in the case
there is only a partial factor match. That needs to be fixed for avoid
this biting us again the future, but we can at least fix it for now.

[1] https://github.com/tox-dev/tox/issues/3219

Change-Id: Ib9f65a4523222f1224d51534c5061f90501b59d3
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-02-15 14:23:45 +00:00
Stephen Finucane f440047475 Drop support for Python 3.6
This was in-effect already dropped with the introduction of the
dependency on platformdirs > 3.0. This just makes it official.

Change-Id: I18806e78fe1491948948d224edb27d6ac4a8f45f
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-11-06 10:55:37 +00:00
Stephen Finucane 84f2850582 tox: Add environment documentation
This should be helpful for new contributors.

Change-Id: I91c14bbaeb61bdf7026015a3eb3f21edae8ec2a9
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-07-28 18:01:28 +01:00
Zuul 147e51f79f Merge "tox: Bump min_version to 4.3.0" 2023-07-28 13:45:55 +00:00
Stephen Finucane 7c5ce14588 tox: Disable E501
This is more trouble than it's worth now. Black takes care of this for
us. I wish I'd decided this before the blackify series :(

Change-Id: Idae7a151fa4f24b932a130669fce563e7150278b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-05-31 17:38:43 +01:00
Stephen Finucane a30f9562df Add 'callback' to 'wait_for_delete', 'wait_for_status'
This is helpful for OSC. We also use the opportunity to clean up the
tests for these two functions since they were fairly janky.

Change-Id: I559e6341b15041cb40fe208439da44c66b7cc6ca
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-05-18 12:48:17 +01:00
Stephen Finucane 7fec4e0bb1 tox: Bump min_version to 4.3.0
tox 4 is significantly faster when it comes to creating virtualenvs and
is far better and detecting e.g. changes to requirements. tox 4.3.0
includes many of the fixes for bugs introduced by tox 4.0 and is a good
default candidate.

Change-Id: I7d29a4a1bc6ee9273e70adc9f382c1d1610f0286
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-05-10 10:58:21 +01:00
Stephen Finucane f526b990f3 Blackify openstack.network
We disable the H301 check since it clashes with black.

Black used with the '-l 79 -S' flags.

A future change will ignore this commit in git-blame history by adding a
'git-blame-ignore-revs' file.

Change-Id: Ib987ac513c4f5e527bf4122b784d0a69856b903e
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-05-03 12:18:48 +01:00
Stephen Finucane 9325626769 Use pre-commit for 'pep8' tox target, bump versions
We want to bump the versions of hacking, but doing so requires changes
in two places: '.pre-commit-config.yaml' and 'tox.ini'. This is silly:
we can simply use tox to handle pre-commit and leave all other
dependencies to pre-commit. Do this, migrating doc8 to pre-commit and
bumping the other dependencies in the process.

Change-Id: I26fa07145129d3ef9cb17693427ed70e55dbaaf5
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-05-03 12:18:41 +01:00
Stephen Finucane 1046b2e367 tox: Trivial fixes
Remove errant whitespace and a commented out line.

Change-Id: Ice5ef168891fe35c4447468dd0d7956ef04db090
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-01-04 12:15:31 +00:00
Clark Boylan a0f969cf92 Update tox.ini for tox v4 compatibility
Tox v4 made a number of changes that break compatibility with old tox v3
tox.ini files. In particular openstacksdk lists env vars for passenv on
a single line separating them with spaces. This is no longer allowed and
produces this error:

  failed with pass_env values cannot contain whitespace, use comma to have multiple values in a single line, invalid values found 'OS_* OPENSTACKSDK_*'

We can fix this by listing each value on a single line which we do here.

Depends-On: https://review.opendev.org/c/openstack/python-openstackclient/+/868430
Change-Id: Ibf4a16e544921ec914f6e23112e0fc37a12096a5
2022-12-26 17:03:59 +01:00
Artem Goncharov 70dbcfcd66 Initialize tests of real clouds
We want to start testing sdk and osc on real clouds. They are all
different, have different settings, policies, etc. In order to cope with
that it would be necessary to rework lot of tests and code to ensure all
of those "feautres" are properly detected by sdk and osc.

Block-storage test base class should not set operator cloud, only tests
that require it explicitly should use it

Change-Id: I09d118097bade8f0d8ff497957846a754ebc7c1e
2022-10-18 14:56:39 +02:00
Stephen Finucane 9e87611aec trivial: Run some files through black
Before major surgery.

Change-Id: I367bf6df230262858d1d414afed4a43ccbdce72f
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2022-06-08 14:38:53 +02:00
Stephen Finucane 11d89450c1 doc: Update testing documentation
The information on how to run functional tests was badly out of date.
Correct it.

Change-Id: I7e77e2a96ab15f7dede01344cb03b0e61c8589bd
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2022-01-27 16:57:36 +00:00
Stephen Finucane 05a83963f7 doc: Remove references to 'examples' test env
This was removed a few years ago.

Change-Id: I8011d652c1f3527b6c5e75b3c3cb1051cfe9bbbe
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2022-01-27 16:57:34 +00:00
Artem Goncharov 0ce0ff092f Merge remote-tracking branch 'origin/master' into feature/r1
Change-Id: I8808a93898c2c51dbba694608bacef26c8be4cc0
2021-12-22 12:28:06 +01:00
Zuul 15883b628b Merge "Changed minversion in tox to 3.18.0" 2021-12-01 11:27:36 +00:00
Riccardo Pittau fae7ab067e Fix import order in block_storage tests
Remove tox filter

Change-Id: Ib2c343daa8fbec569ae57a1c024b8633262a8b19
2021-07-16 12:15:35 +02:00
Riccardo Pittau 2d56b681fe Fix import order in cloud tests
Remove tox filter

Change-Id: I298e3f0d5a2c53fbe31c56dfecf6ea54676c564e
2021-07-16 12:15:07 +02:00
Riccardo Pittau b59cda5cfd Fix import order in clustering tests
Remove tox filter

Change-Id: Ife111995d939f8373637b1668be2f955b58c6189
2021-07-15 12:29:48 +00:00
Riccardo Pittau adcf98c21e Fix import order in orchestration tests
Remove tox filter

Change-Id: I397c715192ac4e47cfe867df22323d30581ba1aa
2021-07-15 12:28:55 +00:00
Riccardo Pittau b86d3a8c3b Fix import order in identity tests
Remove tox filter.

Plus fix some other import orders that were already fixed in master.

Change-Id: I810a5c6718df520323568cb74ad7fcdc2992f85e
2021-07-15 12:27:49 +00:00
wu.shiming dc906fbfce Changed minversion in tox to 3.18.0
The patch bumps min version of tox to 3.18.0 in order to
replace tox's whitelist_externals by allowlist_externals option:
https://github.com/tox-dev/tox/blob/master/docs/changelog.rst#v3180-2020-07-23

Change-Id: Ibfb20cc70b4abc64ea08913a2e69c2d0448a84a8
2021-05-31 15:45:54 +08:00
Riccardo Pittau 30600da911 Fix import order in accelerator and config unit tests
Remove tox filters

Change-Id: I6377230915d4c6d85c6015d7c099448f1dbbae41
2021-05-21 11:47:02 +02:00
Zuul 7c502e50d1 Merge "Revert "Update TOX_CONSTRAINTS_FILE for feature/r1"" into feature/r1 2021-05-15 15:49:22 +00:00
Artem Goncharov 288753558e Revert "Update TOX_CONSTRAINTS_FILE for feature/r1"
This reverts commit 2d16931ca9.

Reason for revert: r1 in requirements will actually never appear. It was an error merging this.

Change-Id: Ifca8f5f0a0cfaed1f6555bacd1256f064efe4f9f
2021-05-14 21:33:59 +00:00
Artem Goncharov 4e730f4dff Merge remote-tracking branch 'origin/master' into feature/r1
Change-Id: I2f4dda93652fb0800d89ce4a9e6d9b67e696bbd6
2021-05-10 15:38:40 +00:00
Zuul d1b11eaf6a Merge "Fix import order in message and workflow unit tests" 2021-05-10 15:01:44 +00:00
Zuul eeb8fdd46d Merge "Fix import order in load_balancer unit tests" 2021-05-10 15:01:40 +00:00
Zuul 297bff6599 Merge "Fix import order in compute unit tests" 2021-05-10 14:43:24 +00:00
Riccardo Pittau 8b343e38f0 Fix import order in message and workflow unit tests
Remove tox filters

Change-Id: Ia7d2fd0b0e824b09d151b4eee6395a2c0debcd6d
2021-05-07 12:59:14 +02:00
Riccardo Pittau 2598947d8b Fix import order in load_balancer unit tests
Remove filter from tox.ini

Change-Id: I2e5e8f0910ab1ff9dffaecfd7fef64e29b3df91c
2021-05-06 11:33:24 +02:00
OpenStack Release Bot 2d16931ca9 Update TOX_CONSTRAINTS_FILE for feature/r1
Update the URL to the upper-constraints file to point to the redirect
rule on releases.openstack.org so that anyone working on this branch
will switch to the correct upper-constraints list automatically when
the requirements repository branches.

Until the requirements repository has as feature/r1 branch, tests will
continue to use the upper-constraints list on master.

Change-Id: I9c01131c4415ad4d0ed5c6cdc6830728734cc261
2021-05-04 16:12:33 +00:00
Zuul d3914d22f5 Merge "Fix import order in network unit tests" 2021-04-22 16:30:25 +00:00
Riccardo Pittau c49bbafb89 Fix import order in compute unit tests
Change-Id: I775d7d37d543e306cd870b56a071f8afbbdd5bb6
2021-04-22 15:09:42 +02:00
Zuul 3e53729441 Merge "Use py3 as the default runtime for tox" 2021-04-22 10:25:55 +00:00
Zuul b6f4485fb5 Merge "Drop lower-constraints job" 2021-04-22 05:36:40 +00:00
songwenping e6d4c4c959 Use py3 as the default runtime for tox
Moving on py3 as the default runtime for tox to avoid to update this at
each new cycle.

Wallaby support officially the following runtimes [1]:
- Python 3.6
- Python 3.8

During Victoria Python 3.7 was used as the default runtime [2] however this
version isn't longer officially supported.

[1] https://governance.openstack.org/tc/reference/runtimes/wallaby.html#python-runtimes-for-wallaby
[2] https://governance.openstack.org/tc/reference/runtimes/victoria.html#python-runtimes-for-victoria

Change-Id: Ic55a211381b901f2203988c0fac4e7545666f382
2021-04-20 01:37:47 +00:00
Riccardo Pittau d1676c24d3 Fix import order in network unit tests
Change-Id: I9bc1d42cfb0cb6574a9f765b21a50e338a98f2b6
2021-04-19 15:42:27 +02:00
wu.shiming d783b5889f Drop lower-constraints job
We facing errors related to the new pip resolver, this
topic was discussed on the ML and QA team proposed to
to test lower-constraints [1].

I propose to drop this job because the complexity and recurring pain needed
to maintain that now exceeds the benefits provided by this mechanismes, and
We need to drop the lower-constraints.txt file as well as the corresponding
tox target

[1] http://lists.openstack.org/pipermail/openstack-discuss/2020-December/019390.html

Change-Id: Ib0ef1fadf4fe44f1d6af2f7d542b8af919652501
2021-04-16 15:15:18 +08:00
Riccardo Pittau abfb719f06 Fix more import orders
Remove corresponding filters from tox.ini

Change-Id: Ic30ee6c568ff78effcfc11b0473d6256f22e17c6
2021-04-13 17:50:11 +02:00
Riccardo Pittau 9081cd54e8 Fixing more import orders
Remove corresponding filters from tox.ini

Change-Id: I009de26adf21c7e6a5076a2432e3fce057743475
2021-04-13 17:41:42 +02:00
Zuul 2c5200748d Merge "Apply import order in more tests" 2021-04-07 11:53:28 +00:00
Zuul 61770d9219 Merge "Fix more import order in tests" 2021-04-07 11:53:20 +00:00
Zuul 1d4fbe610f Merge "Apply import order in some tests" 2021-04-07 11:51:23 +00:00
Riccardo Pittau 768a114c90 Apply import order in more tests
Remove corresponding filters from tox.ini

Change-Id: Ifa3741bafc88901f330bfc81d2d464fd54859dd8
2021-03-25 14:53:04 +00:00
Riccardo Pittau d376c4fc5c Fix more import order in tests
Add single filters in tox.ini

Change-Id: Iab7d348f85e6f5cbc2fc2e1257a1f8055c049225
2021-03-25 14:52:52 +00:00
Riccardo Pittau 9bee004a04 Apply import order in some tests
Modify the tox.ini filter

Change-Id: Icfb869a8283158391756b4f54608adc0f2f4754a
2021-03-25 13:51:45 +01:00
Stephen Finucane 5ba1e90273 tox: Enable parallel docs build
Add the '-j auto' flag to all 'sphinx-build' invocations. While we're
here remove the unnecessary '-d DIR' argument: Sphinx will configure a
sane doctree directory for us without any special configuration. This
results in a tidy little speed boost. Before:

  real    1m23.772s
  user    1m9.665s
  sys     0m6.299s

After:

  real    0m54.613s
  user    1m26.129s
  sys     0m7.810s

Change-Id: Id9240456f8bb289620a64792b433dbde4fa09586
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2021-03-24 13:46:10 +00:00
Riccardo Pittau a714e096f3 Apply pep8 import order style
Update version of tox to 3.9.0 to support inline comments in tox.ini
Import pep8 test requirements directly in tox.ini and do not import all
the test-requirements
Update version of hacking
Fix import orders in various modules

Leave filter for imports in tests/ for the time being

Change-Id: Ia625036d1f50ae97880ef70335804228320a9c6d
2021-03-08 16:50:54 +01:00