Pytest makes each scenario into individual selectable test.
To be able to run each scenario separately is very useful for development.
Change-Id: I4b1c990a1fd839ce327cd7faa27159a9b9632fed
Sphinx was pinned to >1.5.0 <=1.7.0 4 years ago. It is now on v4.4.0,
and we're seeing an incompatibility with the latest version of jinja2.
Along with updating the Sphinx version, this also includes fixes for
several warnings generated in the latest version:
* Outdated docs due to the removal of the "parser" param from
Base.get_xml
* Class lookup issues
* External links for which we have extlinks defined
* Deprated PyModulelevel is replaced by PyFunction
* sphinx.ext.autodoc.Documenter.get_doc signature changed
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
Change-Id: Iba65fb724f098f3e4a0b20f2a183cb2ea3c450ea
Black dropped Python 2 support in 22.1.0. Unfortunately we can't pin
the version as <22.1.0 becasue in the past Black was versioned using
just main.major, not main.major.minor, and they were only releasing beta
versions, hence the 'b' suffix.
Pluggy 1.0.0 dropped Python 2 support.
It seams JJB should drop support for Python 2 too. Otherwise it will
be harder and harder to maintain dependencies...
Change-Id: I13b82a02bb50ab46183ff04aae521b44e475f743
The 'mock' package is imported in 'tests.base'. Whenever possible
'tests.base' prefers 'unittest.mock' over 'mock' (which is the case on
Python 3.3+). Importing 'mock' together with 'unittest.mock' causes
unexpected behavior that results in exceptions when running tests, at
least on Python 3.6.12, like:
> File "/usr/lib/python3.6/unittest/mock.py", line 1196, in patched
> patching.__exit__(*exc_info)
>
> File "/home/zuul/src/opendev.org/jjb/jenkins-job-builder/.tox/cover/lib/python3.6/site-packages/mock/mock.py", line 1545, in __exit__
> return exit_stack.__exit__(*exc_info)
>
> File "/usr/lib/python3.6/contextlib.py", line 339, in __exit__
> received_exc = exc_details[0] is not None
>
> IndexError: tuple index out of range
From now on, to avoid similar issues in the future, the 'mock' package
is only installed for Python 2.x.
Change-Id: Ib3044312f0770735d88d8657d1f953e5a33e771f
stestr 3.0.0 does not support python 2.7 but has been released without
the proper metadata to reflect that. As a result, there is a python2 wheel
stestr-3.0.0-py2-none-any.whl which get picked up.
Blacklist stestr 3.0.0 to fix '--list': no such option error
Change-Id: I11898e1021973fa4c3031f1388d58d868feb601a
Linters only requirement is pre-commit, as the tools takes care of the rest.
This speeds up linting and lowers disk footprint by removing unnecessary deps.
Change-Id: I82b974a5257671bc2e8e987d0f556ddae345feea
- upgrade flake8 to 3.6.0
- remove use of hacking since pre-commit replaced it
- mentioned minimal flake8 version on pre-commit config
- fixed newer linting errors
- disable W504 as it seems not possible to fix (conflict with W403)
- replaced buggy tox deps installation with native pip install, which
address the issue of missing to install new deps when the reqs files
are updated, developer being forced to to recreate the virtualenv.
- prepare for migration from tox-pep8 to tox-linters, now these being
just aliases.
Change-Id: I310578dce215aaf00a5b2d54716f90da9a1ecb4d
Depends-On: https://review.openstack.org/#/c/613726/
- upgrades hacking to current version
- sorts new linting issues
- sorts bug with sys.reload on py3
Change-Id: I4a18abc93116667a2733e8aec619ac59ea73d630
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
Switch to use stestr which is maintained as opposed
to testrepository (testr) which became a defunct project.
Change-Id: I47f628a7d224189362f2b2cfd9fe4c54af198cde
If I understand correctly, tox is already installed on automated test
nodes; however, the intent here is to improve local development workflow
by ensuring that an appropriate version is installed for running tests
locally.
This requires at least tox 2.9.1, which is the version that was used in
a zuul run observed today.
Change-Id: I8052e5792e229b58a48e48bd705ed576acdc2884
This is not necessary - jenkins-job-builder does not follow the
requirements sync process. That said - these are likely all safe bets
for being solid versions of these dependencies - and some of them were
kinda stale.
Change-Id: Id1941ff4c9736100f9bdd5508ec3c0377e51fdbe
For some reason docs builds break when using the sphinx version listed.
Just use the same one as the rest of OpenStack.
Also - while we're at it - setuptools_git hasn't been a thing in a LONG
time.
Change-Id: I70d45f5b237ceb9b67ca4ce458816f41a197d228
JJB docs are published to readthedocs.org but fails to build because
RTD only supports a newer version of sphinx. Updating sphinx to
version 1.3.1 so build won't fail on RTD.
depends-on: Iba92628263e20efca84aeada0e19000f4c9b1fac
Change-Id: Ia8d4033bf2def5066bda26813b41338408093481
Update version restrictions to allow hacking module <= 0.10.1 and fix
any style errors reported by the latest version.
Change-Id: Ia608096342b11e411e56a86e8f289f9891077895
Need ordereddict in the requirements as it is used at run time by the
yaml parsing code not just a test time.
Change-Id: Ic41e7adb5a06ed319f6201a13b9f7391fc245853
Python 3 enables hash randomization by default, additionally tox 1.7
turns on the same randomization for earlier versions of python by
default. Need to ensure that order of iteration over the yaml data and
resulting XML has deterministic order for testing.
Adapts https://gist.github.com/enaeseth/844388 which ensures data read
by yaml will have its order retained in a predictable manner across
multiple python versions.
Additionally it seems more sensible to ensure that the order of
generated XML snippets corresponding to the input yaml files are
consistently in the same order as the entries in the source files.
Closes-Bug: #1333349
Change-Id: I6bf6d298a2609cc6ddbbc6b02b7f1a04413a5c89
Add a few tests for JJB command processing. This is just to get
started I'm hoping more will come.
Change-Id: Iff964af025f6a3d7ba4acd91b1e0242285a11bc3
Solely for the transitive dependencies. Ignore errors from hacking
as do the other openstack-infra python projects.
Change-Id: Ib5953c31a5380f9f57c7f79e1ce0699aef5eb629
I found out pbr to be a bit nicer when it comes to edit files. AFAIK
most OpenStack project are using it, so I guess Jenkins Job Builder can
be pbr based as well.o
Basically:
* moved everything from setup.py to setup.cfg
* sorted entries while at it
* require pbr module using the same version limits used by Zuul
* enable pbr.warnerrors
* testenv.usedevelop = True or build_sphinx can not find entry points
* move requirement files to root of repository (we had them in /tools/)
Change-Id: I44ee8910ad4fe4eebb7337951efa31baff4281fe