Commit Graph

33 Commits

Author SHA1 Message Date
Ghanshyam Mann b6505e20ba Use pypi released version of placement in functional tests
osc-placement functional tests are using the master version
of placement which is failing due to the constraints mismatch
on stable branches testing.

- https://zuul.opendev.org/t/openstack/build/a2cc830f28f44ed5ae0e1c5f0a99ac75

During the discussion in Nova meeting, we did not find any reason why
we are using the latest placement on stable branch testing of osc-placement
- https://meetings.opendev.org/meetings/nova/2023/nova.2023-01-10-16.00.log.html#l-47

Below is the original patch which started using the placement from master
source.
- https://review.opendev.org/c/openstack/osc-placement/+/651939

To avoid the constraints mismatch on stable branch testing which can
happen in future also, let's use it from pypi version which will be the
same way as nova functional tests doing
- 26f24b7086/tox.ini (L64)

Also, remove basepython/ignore_basepython_conflict from tox.ini. Tox 4.2.6
still failing with the missing interpreter for [testenv:functional{,-py38,
-py39,-py310}]. It is due to a conflict between basepython = python3
and the version fragment in the generative target suppressed by
ignore_basepython_conflict = true.

This patch removes basepython = python3 assuming that developers already
switched for python3 in their environment as python2.7 is EOL.

Ref: https://review.opendev.org/c/openstack/nova/+/869545

Change-Id: I4e3e5732411639054baaa9211a29e2e2c8210ac0
2023-01-10 14:50:45 -06:00
Balazs Gibizer fdf10423bf Make tox.ini tox 4.0.0 compatible
* removed skipdist=True to make sure osc-placement is available in the
  virtual env

Depends-On: https://review.opendev.org/c/zuul/zuul-jobs/+/866943
Change-Id: I9891ce31b45694c0d5be5da3a99173136272dfc6
2022-12-22 16:15:31 +01:00
Ghanshyam Mann e326856965 Update gate jobs as per the 2023.1 cycle testing runtime
As per 2023.1 testing runtime[1], we need to test on Ubuntu
Jammy (which will be taken care by tempest and devstack patches
to move base jobs to Jammy) and at least single job to run on
Ubutnu Focal (for smooth upgrade). Also, python 3.10 testing is
voting now.

This commit makes python 3.10 functional job as voting and python 3.10
unit test job are voting via generic template. Python 3.8/3.9 jobs are
running on Focal and python 3.10 on Jammy.

[1] https://governance.openstack.org/tc/reference/runtimes/2023.1.html

Change-Id: I97b82399af9a640353ba979965c202afcb224163
2022-11-22 19:47:01 +00:00
Zuul b3bee2939a Merge "Change minversion of tox to 3.18.0" 2022-06-06 01:45:28 +00:00
Takashi Natsume 9101797227 Add Python3 zed unit tests
This is an automatically generated patch to ensure unit testing
is in place for all the of the tested runtimes for zed.

See also the PTI in governance [1].

I needed to squash in another change that is dropping the py36 and py37
support. We cannot do that separately as those jobs are already failing.

[1]: https://governance.openstack.org/tc/reference/project-testing-interface.html

Change-Id: I378d5c3c1f3e96696670a4865caf5901269a5ee4
2022-06-01 14:08:13 +02:00
Takashi Natsume d4ef2a9494 Change minversion of tox to 3.18.0
The patch bumps min version of tox to 3.18.0 in order to
replace whitelist_externals with allowlist_externals option:
https://github.com/tox-dev/tox/blob/master/docs/changelog.rst#v3180-2020-07-23

Change-Id: I004d9563d006a1cce1e2fe7fbcd11fbf41e023fe
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
2022-03-29 11:36:04 +09:00
Ghanshyam Mann 0c24adb61e Updating python testing as per Yoga testing runtime
Yoga testing runtime[1] has been updated to add py39
testing as voting. Unit tests update are
handled by the job template change in openstack-zuul-job

- https://review.opendev.org/c/openstack/openstack-zuul-jobs/+/820286

this commit makes other required changes in zuul.yaml and
update the classifier in setup.cfg file.

[1] https://governance.openstack.org/tc/reference/runtimes/yoga.html


Change-Id: Ia2caf2508604743cfddbdc76bc520641d1c647d1
2021-12-14 02:26:24 +00:00
Zuul b6f1e6b450 Merge "Add py38 package metadata" 2021-05-14 15:22:05 +00:00
Zuul 4cb78129e5 Merge "Use TOX_CONSTRAINTS_FILE" 2021-05-14 15:21:58 +00:00
Balazs Gibizer 8def9e82eb Add functional-py39 tox target
This patch also adds a non voting job calling the new target

Depends-On: https://review.opendev.org/760932

Change-Id: I37a2cded4f1685cfe433efe53154da12fedadce6
2020-11-04 13:44:36 +01:00
likui e27453e0c3 Use TOX_CONSTRAINTS_FILE
UPPER_CONSTRAINTS_FILE is old name and deprecated
-https://zuul-ci.org/docs/zuul-jobs/python-roles.html#rolevar-tox.tox_constraints_file
This allows to use lower-constraints file as more
readable way instead of UPPER_CONSTRAINTS_FILE=<lower-constraints file>.

[1] https://review.opendev.org/#/c/722814/

Change-Id: I116087d2bf1d3ff40c210529be2a4808581eb87b
2020-11-01 16:30:41 +08:00
likui c16bff5abc Add py38 package metadata
in 'victoria' cycle, we should test py38 by default.

Change-Id: I051511644d75781aa1080fd9f7fadbfc6ce5a902
2020-10-09 18:17:25 +08:00
Stephen Finucane a7aa5a890c tox: Trivial cleanup
- Add some helpful descriptions for the various environments
- Use lower-case boolean values (they're prettier)
- Remove some unnecessary warning filters for issues not present on
  Python 3.6+
- Move the 'venv' target to the end of the file, indicating its priority
  (quite low)
- Fix a bit of wonky indentation

Change-Id: Ia083f959d2a9c974b4c0592fdada21dcc766dca4
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2020-08-07 10:38:01 +01:00
Stephen Finucane f463abfc58 tox: Add functional-pyNN targets
tox isn't all that clever when it comes to handling non-existent
environments with multiple factors. Without these explicit
'functional-pyNN' targets explicitly defined, attempting to run e.g.
'tox -e functional-py36' will actually end up running the default
'testenv', which run *unit* tests. This is almost certainly a bug in
tox, but we need to fix it here to get functional tests passing again.

Change-Id: If47eb0da2b04d7a288f53e80f0addd72edcd9e7a
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2020-08-07 10:28:50 +01:00
Andreas Jaeger 2abc37868b Cleanup py27 support
This repo is now testing only with Python 3, so let's make
a few cleanups:
- Remove python 2.7 stanza from setup.py
- Add requires on python >= 3.6 to setup.cfg so that pypi and pip
  know about the requirement
- Remove obsolete sections from setup.cfg
- Update classifiers
- Update requirements, no need for python_version anymore
- Switch to using sphinx-build
- Use newer openstackdocstheme version
- Remove install_command from tox.ini, the default is fine
- Update to hacking 3.0, fix warnings

Change-Id: If66a87c519ce82ee7890ac3e133afef13fb35bd2
2020-04-13 11:28:10 +02:00
Zuul 066fe939eb Merge "Remove redundant functional-py3* tox environments" 2019-12-18 16:54:05 +00:00
Zuul e4ceef795a Merge "[ussuri][goal] Drop python 2.7 support and testing" 2019-12-06 01:05:01 +00:00
Matt Riedemann 1fb7a255aa Remove redundant functional-py3* tox environments
The functional-py36 and functional-py37 targets are
now redundant with their parent functional target
which is now using basepython=python3 so just running
tox -efunctional will run with whatever python3 environment
is on the host, e.g. py36 on standard ubuntu bionic:

  $ python3 --version
  Python 3.6.8

Change-Id: Ibb679e0cffa18291b91f10b19559d2a68e986486
2019-12-05 19:57:06 -05:00
Tetsuro Nakamura 52ef27a8ce [ussuri][goal] Drop python 2.7 support and testing
OpenStack is dropping the py2.7 support in ussuri cycle.

"osc-placement" is ready with python 3 and ok to drop the
python 2.7 support.

Complete discussion & schedule can be found in
- http://lists.openstack.org/pipermail/openstack-discuss/2019-October/010142.html
- https://etherpad.openstack.org/p/drop-python2-support

Ussuri Communtiy-wide goal:
https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html

Change-Id: Ibd9d1c839f820d8c8ea0ad0979d5dca9223d11dc
2019-11-23 15:57:43 +00:00
Matt Riedemann 3ac639bcf7 Fix deps for using venv tox target to create a release note
The reno package dependency is in doc/requirements.txt which
needs to be in the tox venv target deps if you want to create
a release note using:

  tox -e venv -- reno new <slug>

Change-Id: Ifa1fd55b2c8a3f65a74d9e5e2f0482d015c97723
2019-10-25 15:32:45 -04:00
Stephen Finucane 0cae0bc84e Fixups for pdf docs
- Don't remove badges - simply exclude them from the main docs.
- Don't include stuff that only makes sense in HTML - namely the indexes
- Don't explicitly set basepython in a tox testenv when we can inherit
  it

Change-Id: Ib3db3888d0bb1c47773e3e44919c7077d0906ceb
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2019-09-24 17:26:39 +01:00
Chris Dent 99d879abfd Build pdf docs
This follows the instructions [1] in an attempt to build pdf docs.

To get a build, the "badge" in the README has been removed.
The other option to add some svg -> pdf support, but that seems
overkill for a badge which is effectively meaningless.

The build wanted 'xindy' to build an index, but we can turn that
off and still get useful results.

[1] https://etherpad.openstack.org/p/train-pdf-support-goal

Change-Id: Icf7c22bf9d1de6fb2a74a756c370930d4c00b0b9
Story: 2006110
Task: 35397
2019-09-11 16:21:06 +01:00
Corey Bryant 75f2480427 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: I530fcaba664cd21e46ddf8011919954281a04865
Story: #2005924
Task: #34236
2019-07-05 15:43:06 -04:00
caoyuan 78b1f3ea82 Replace git.openstack.org URLs with opendev.org URLs
Also fix some remaining inconsistencies in tox.ini

Change-Id: I2f690a9910351afd52703e4a0c537fa3b011f778
Closes-Bug: #1826823
2019-06-11 10:11:20 +01:00
Chris Dent da8cd4d68b Use PlacementFixture in functional tests
Change the functional tests to use the PlacementFixture instead
of devstack as the source of a placement API. This speeds up
the tests considerably and lowers the number of dependencies.

There are four primary changes:

* For each test a PlacementFixture is instantiated, using the
  usual in-RAM db and in-process placement.

* Because of some exceedingly confusing optimizations in
  osc_lib and python-openstackclient, done to improve start
  up time, a session to placement was caching the service
  url. This meant that after a first test succeeded, every
  subsequent one would not because it was trying to talk
  to a fake hostname that was no longer being intercepted.

  The workaround for this was to monkeypatch the method
  in the ClientCache class which provides access to a client (per
  service-type). The replacement method makes a new client
  every time.

* The previous tests would subprocess out to a real call of
  the openstack command and then interpret the results.

  Now, a run() method on OpenStackShell is called instead.
  This accepts arguments in the same way, but we need to
  a) capture stderr and stdout, b) make a try/except for
  SystemExit to get some error responses (mostly from
  the argparse lib which has a tendency to exit for you
  instead of politely telling you it wants to), c) deal
  with errors from commands ourself rather than using
  exceptions from the subprocess module.

  Switching to this form means that logging becomes in-process
  and more visible. To accomodate this the Capture fixture
  from placement is used. This was chosen because we are already
  pulling in the PlacementFixture. If this seems icky, I can fix
  it with a local one. This was the shorter path.

* The legacy dsvm jobs have been removed in favor of "standard"
  functional jobs for 2.7 and 3.6 that require openstack/placement.
  The playbooks associated with the legacy jobs are removed.

  tox.ini is adjusted to reflect this new setup. Because tox-siblings
  functional is being used, we don't want to share tox envs with the unit
  tests. The 3.5 functional job is removed because we no longer target
  that.

After running these for a while it became clear that there were
intermittent failures being caused by subunit attachments being too
large. This was eventually traced back to logging from all packages
being set to DEBUG even when something else was requested. That was
traced back to a poor interaction between the way that osc does
logging and the way oslo_logging does logging (used by placement and
thus the placement fixture). The workaround, embodied in the
RESET_LOGGING list in osc_placement/tests/functional/base.py, is to
get and reset the log level for a subset of the packages that are
used.

Change-Id: I7deda200b372ff6a7ba67b0c4fa0e53c4fa16ffc
Story: 2005411
Task: 30428
2019-05-03 15:04:56 -06:00
Chris Dent dbd50cbf97 Use openstackdocstheme instead of oslosphinx
The latter does not work well with Sphinx 2.0.

Switching brings us up to date with modern norms. The
changes made here are to get it working:

* Changing tox jobs to the modern style, with a separate
  requirements.txt in the doc directory.

* Updating doc and releasenotes conf.py to use the new
  theme and correctly point at storyboard for bugs

* Remove docs related requirements from test-requirements.txt

Change-Id: I9770f375b0fd7a6cacdd02e3d0381a28879f18b5
2019-04-05 11:41:52 +01:00
Chris Dent fc563d37bc Update tox and tests to work with modern setups
While trying to make some changes I discovered that the tox
configuration for osc-placement was rather out of date and
functional tests were not working for python3. With this
change we bring tox.ini into a style that is more in keeping
with modern standards, use stestr, and update some functional
tests so they work with python3.

The functional tests changes are either:

* to fix the decoding of response
* to adapt argparse error response checking between python
  version.

These changes cascade some required change into how the gate-side
functional testing is performed. We make it explicit that in the
python2 job, the 'functional' tox job is run. When the python3
job is run, 'functional-py3' is run. Also stestr replaces
testr in the post-test hook.

When the functional-py3 test had been run in the past it
was actually running a python2 osc-placement against a
python3 devstack. We change that here to be python3 and
python3. Once that was happening, additional failures
were revealed, now fixed.

One particular issue was that while the json module
for python 3.6 and greater will decode strings or bytes,
the version of 3.5 will only do strings. We switch
to using simplejson throughout which smooths things over.
This is added as a new requirement but it isn't really:
simplejson is required by osc-lib.

Finally, some requirements need to be tuned to pass the
gate requirements job.

Change-Id: I999a3103dd85c0a437785766eef533875fca31fc
2019-03-01 04:12:18 +00:00
Stephen Finucane 7152b9177b tox: Hide deprecation warnings from stdlib
This makes the output sooo much more readable.

Change-Id: I3376d2d97ebfd014006e69710c00d859491c92ce
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2018-12-05 10:42:18 +00:00
Matt Riedemann e3a3b8b86a Remove doc/build during tox -e docs
This removes the previously built docs so that
we get a fresh build each time to pick up the
latest changes.

Change-Id: I3c5da78f2aee85810eabe7c71cd89caa0d65e541
2018-06-28 22:38:54 -04:00
Doug Hellmann 06b5738a3a 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: I7874fc8375c14fcc9567b6c23bc1c070bc6d29c9
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-06 15:27:01 -04:00
Ameed Ashour f654329297 tox.ini settings for global constraints are out of date
there are differences between oslo.config tox.ini and
placement-osc-plugin tox.ini .

Change-Id: I810c17e8f3bd1ac1f276869d69443ed2c47c8f7d
Closes-Bug: #1745471
2018-02-12 01:37:01 -05:00
Roman Podoliaka 5769a511e9 tests: add a hook for functional testing in the gate
Follow the python-novaclient approach of running functional tests
against a deployed Devstack in the gate.

Blueprint: placement-osc-plugin

Depends-On: I7c5a5c10288b356302bb3027837d4ed4f0fbad8c
Change-Id: I8ca156440cb51d03cb8e05185c028573dc6f9b4b
2017-04-20 18:04:37 +03:00
Roman Podoliaka 2c538f3ea0 Initial commit
- import coockiecutter template
- set up basic testing
- implement interface of an OSC plugin
2017-03-22 11:58:28 +02:00