Pytest makes each scenario into individual selectable test.
To be able to run each scenario separately is very useful for development.
Change-Id: I4b1c990a1fd839ce327cd7faa27159a9b9632fed
Change I42660519c1cbe94a4322767b1940e113b0e5a276 missed dropping support
for Python 3.6 which is also EOL.
This is not noted as a breaking change as the release email that went out
for JJB 4.0.0 already addresses that we will be dropping support for
Python 3.6 and older so this simply removes the CI testing associated with
that statement.
Change-Id: Ia146401460c8978d1b53213413bf92d5aef9a3cf
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
This toxenv will allow us to flag URLs that no longer work. We
also switch from using old style setup.py build_sphinx to the
newer sphinx-build command.
Change-Id: I62f42918814fb6eea4876e0d22c6bccddf86a826
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
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/
Enable us to do `python -m jenkins_jobs ...`
which avoids the need to install executable in
user path.
Tests cli execution on each supported python version.
Uses default encoding workaround only on
python2, where is needed.
Change-Id: I4cd79fd51a8309d532e0e76723ecfbbda3e1ca6f
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
This reverts commit 51a4ccab70caba694fbf113548cf564139b0c0c8.
Change-Id: I52b3ff4699f6907cb481f016fb55fb9102c48b98
Signed-off-by: Thanh Ha <zxiiro@linux.org>
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: I78f552cfb434b6bac30a77c5f2011636308fbbee
Before the yaml parser was modified to use OrderedDict
test input/output could be incorrectly ordered relative
to the expected output. This has long been fixed and we
should now be able to remove this setting.
Change-Id: I165c3fd4189d2d0d87cc5da565cbba7df236e326
Switch to use stestr which is maintained as opposed
to testrepository (testr) which became a defunct project.
Change-Id: I47f628a7d224189362f2b2cfd9fe4c54af198cde
This allows us to spot things that may be broken
by changes made to dependencies.
Adds zull job that tests tips of both projects.
Adds 'tips' tox environment that can be used by
developers to perform the same kind of testing
locally.
Change-Id: I35dbdf6acab1062109dc4b1f1474decd75932504
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
Adds multiple py3x versions to the default list in oder
to assure that they are used when available.
Some systems are already using py36 but other production
systems are have only py34, like RHEL 7.x.
This should have no effect on gates as they specify exactly
their targets, but it does improve developer testing.
Change-Id: I6225f1d8cd7cb0022817d8dc1f459403bbd57f8e
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
Avoids occasional test executions failures
caused by leftover files on dev machine or
by preexisting configuration files.
Change-Id: Ia0ba29e2dda58c37410a6926cae3039e4ba3473e
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 users in a proxy environment, checking the doc urls requires being
able to pass through the proxy environment variables. Include a simple
comment along with the tox command requiring it to help users checking
any links added are valid.
Add some references to documentation, both in the detailed
documentation and the quick README.rst that would be more commonly
checked.
Change-Id: I2316bc1b7e845c29a8b248eef4668a6099d109f7
This commit intentionally introduces a number of important API
breakages. Specifically, the jenkins_jobs.cmd module has been pared
down to some of its most difficult-to-refactor elements.
* Create jenkins_jobs.cli.entry.JenkinsJobs class to organize command
line parsing and execution.
* Remove references to ConfigParser object in test code, hidden as an
implementation detail of JenkinsJobs command line parsing. This will
be necessary in the next stage of JJB 2.0 code which will be to
create a JJBConfig object that handles logic and presentation of
configuration from various sources--defaults, command line
arguments, configuration file, and maybe environment variables in
the future.
* Remove references to Namespace object produced by argparse module.
Required rewrite of multipath & recursive path tests with a new
MatchesDir testtools Matcher class that validates the expected
output for a run of JJB against a given set of yamldirs with the
specified command line arguments.
* Use stevedore to dynamically load subcommand parsers.
* Move configuration loading/testing to its own test file. Also fix
the global vs home directory JJB config file test.
Change-Id: If62280418ba7319c313033ab387af4284237747e
Ensure we can provide multiple configurations to exercise different
behaviour within modules with complex job definition inputs.
This ensures that behaviour can be put behind config options, while
providing a platform to exercise these non-default values with the full
complexity of the OpenStack JJB definitions.
Since config options may result in different output, success is
determined by simply succeeding in executing JJB without error.
For additional review, any differences are outputted.
Change-Id: Ifd2b48ae85fbe7b5a2858dd426137c735c6ccd02
Add separate linkcheck tox environment to be used in non-voting Jenkins
job to watch for stale and broken links in the sphinx generated html
documentation. Include a small addition to make it easier for
contributors to select individual builders when executing the docs tox
environment.
Add minimum dependency of pbr 1.0.0, as that was the first version to
allow passing of sphinx builders on the command line to override the
internal defaults or those set in the configuration file.
This will make it easier to spot problems with just the links, and also
ensure that when the sphinx project releases with proper warniserror fix
for the linkcheck builder, that html and man page documentation can
continue to be built even if a previous valid link has become stale or
is temporarily unreachable.
Change-Id: I80446abe96824a444a04cc526df6cc38632a4607
Exclude the .test directory, created by running the comparison of
changes to the XML outputted caused by the current revision, from the
pep8 checks.
Change-Id: I07d06819e0db29efb27bf0f7e4de05bef5bc3a7e
Tox 2.0 does not pass the environment from the caller through anymore.
THis means your locale LANG setting is not set which makes the utf8
tests unhappy in JJB. Correct this by explicitly setting a LANG of
en_US.UTF-8. The important bit is the UTF-8 specification, en_US was
chosen somewhat arbitrarily.
Change-Id: I0fc5b5ab80414b392b7cebe9b4e0ebc5cc42c61c
As per the governance resolution https://review.openstack.org/119875,
projects should have a docs environment in their tox.ini testing
interface. Rename the doc environment to docs.
Change-Id: I1ad04bd2c3a0404a2ee6d809154c72bc896d0c36
The JJB unit tests no longer pass, due to an upgraded version of
tox which sets PYTHONHASHSEED to random values. Since the ordering
problem introduced is a difficult one to smash, this just sets
PYTHONHASHSEED to 0. This also fixes the syntax of the
"[testenv]setenv" configuration setting.
Change-Id: I61fdbdf1a5099bcbacaeba59ff5001bb23df8cfd
Related-Bug: #1348818
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
The Sphinx documentation now make use of the `program-output` plugin
which would invoke commands to generate inline documentation. Ex:
program-output:: zuul --help
program-output:: zuul enqueue --help
We want the resulting output to correspond to Zuul source code, not the
command which is currently installed on the host running the doc. On my
setup sphinx would die out because it cant find the command 'zuul'.
The new tox environement 'doc' runs sphinx in a virtual env which will
have the proper zuul command.
The generated doc is not written under the /.tox directory but to
/doc/build/html for convenience.
Example usage:
tox -edoc && open doc/build/html/index.html
Change-Id: Ib0170f94bb2c09eb60e555a32e101e2e0959b18e
* tox.ini: By default tox passes --pre to pip install commands so
that prerelease packages will be deemed automatically suitable, as a
means of keeping backwards-compatible with earlier pip releases
which did not interpret version strings looking for potential
prerelease patterns. By overriding the install_command in tox 1.6
and later, this option can be removed from the pip command line so
that prerelease versions of packages will only be installed if a
version spec for a particular package is also a prerelease.
Change-Id: I978b906b0ecd6c01c99e08f9d27271a1f31c7a14
I am trying to build up a very basic testing framework so we can tests
our publishers. The idea is to provide a YAML input file and expected
XML output, run the parser on the YAML file and compares its output with
the fixture XML.
That test suite should speed up development of new publishers.
TestCaseModulePublisher is declared inside a function so that unittest
discovery does not consider it a usable test directly. load_test is
responsible for instantiating the test suite.
Change-Id: If3260113eb1337ac47c3883b11c600e5a595dae3
[fabre.arnaud@gmail.com: fixed some runtime errors]
Signed-off-by: Arnaud Fabre <fabre.arnaud@gmail.com>
However due to an upstream bug[1] we ignore E125 for now.
[1] https://github.com/jcrocholl/pep8/issues/126
Change-Id: I75337d9194156580cc66666aed9a5bc2fd5d4e15
Signed-off-by: Paul Belanger <paul.belanger@polybeacon.com>
Reviewed-on: https://review.openstack.org/16604
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
I'm looking at you setuptool-git
Change-Id: I0b40bc2d902b056085567b7ac740fefd9f5950f0
Signed-off-by: Paul Belanger <paul.belanger@polybeacon.com>
Reviewed-on: https://review.openstack.org/16545
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins
Since the project uses entrypoints so heavily - move the jenkins-jobs script
to be contained within the project and have entrypoints generate the script.
Change-Id: Ie9541163c8677de1b05576491c8e9e63d3bd25fc
Reviewed-on: https://review.openstack.org/15816
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
Move test.sh to the tools directory.
Move parameters and notifications to their own modules; even
though they are implemented as Jenkins properties, they make
more sense as separate entities in the job builder, because
that's they way they are specified in the YAML. All three
modules that touch the properties xml object know how to
create it if it's missing.
Change-Id: I4b42ff10a93fd3ed98f632b58e47f3e0e45086d6
Reviewed-on: https://review.openstack.org/12741
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
Make it easier to invoke the tox environments from another project
(eg, openstack-ci-puppet).
Change-Id: I88305c8edb79bb6e944eb35f5e39c84827807f11
Reviewed-on: https://review.openstack.org/12451
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
Change-Id: I5e0b76e195a1b412d180484ce1ddd3e9159d7779
Reviewed-on: https://review.openstack.org/12286
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
Change-Id: I4d6312e92dffd596ae58e55c837e3db3ea7d1c52
Reviewed-on: https://review.openstack.org/11198
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins