Commit Graph

50 Commits

Author SHA1 Message Date
Vsevolod Fedorov 35a75d28e5 Add support for Python 3.11
Change-Id: I4db0a458e054becc924726f25fff2cf0a80f3cc9
2023-12-19 12:10:43 +03:00
Vsevolod Fedorov 5ebd23af38 Add support for Python 3.9 and 3.10
Change-Id: I086932c0a5748dc98f7fcac0a0393f426a891ac2
2023-04-04 13:19:35 +03:00
Piotr Falkowski 927bb1919b Support for follow-symlinks in archive publisher
Change-Id: I1d5bd1c6ef5ccdf5f304dabf3a9afcb59d2b2baf
2023-01-16 22:06:49 +01:00
Vsevolod Fedorov f4d64f9f66 Move tests to pytest
Pytest makes each scenario into individual selectable test.
To be able to run each scenario separately is very useful for development.

Change-Id: I4b1c990a1fd839ce327cd7faa27159a9b9632fed
2022-12-20 10:44:43 +03:00
Thanh Ha 7e860919a8
fix: Drop testing for Python 3.6
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>
2022-04-12 12:28:03 -04:00
Eric Ball ca4ffdbb35
Fix!: Remove support for EOL python versions
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
Change-Id: I42660519c1cbe94a4322767b1940e113b0e5a276
2022-04-11 10:00:41 -07:00
Adam Romanek dbd8c24a1b Enable official support for Python 3.7 / 3.8
Change-Id: I9f38fd8afc082dd675edb94d6dbd5c18cc19f2a2
2021-01-07 00:43:58 +01:00
Thanh Ha c3ef26c1b0
Ignore py:obj warnings and fail on warnings
* Enables fail on warnings and enable nitpicky
* Consolidate string -> str for args

Change-Id: Id5c29d48813fd6f772816dc74c7c4e408097113d
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
2020-01-22 20:43:52 -05:00
Thanh Ha 7b00932d2c
Enable docs-linkcheck
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>
2020-01-06 09:50:13 -05:00
Sorin Sbarnea 7754995474 Correct dependencies on tox linters
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
2019-07-13 15:19:54 +01:00
Sorin Sbarnea 539d13e816 Fix flake8 failures and make its execution more consistent
- 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/
2018-10-28 11:44:43 +00:00
Sorin Sbarnea 4953756c27
adopt pre-commit hooks
Change-Id: I98bc0b5717c3921b35e74f53c55f896427880a84
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
2018-07-12 13:40:38 +01:00
Zuul ac0d4c99ef Merge "Revert "fix tox python3 overrides"" 2018-06-29 15:10:08 +00:00
Sorin Sbarnea 92f28a591e
Allow jjb to be called as a module
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>
2018-06-19 23:25:43 +01:00
Thanh Ha 51611506e0
Revert "fix tox python3 overrides"
This reverts commit 51a4ccab70.

Change-Id: I52b3ff4699f6907cb481f016fb55fb9102c48b98
Signed-off-by: Thanh Ha <zxiiro@linux.org>
2018-06-19 17:38:36 -04:00
qingszhao 51a4ccab70 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: I78f552cfb434b6bac30a77c5f2011636308fbbee
2018-06-19 17:26:36 +00:00
Darragh Bailey b66f8d1d65 Use of OrderedDict allows hash seed != 0
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
2018-04-25 15:36:36 +01:00
Sorin Sbarnea c8ba7a5a0f Replace testr with stestr
Switch to use stestr which is maintained as opposed
to testrepository (testr) which became a defunct project.

Change-Id: I47f628a7d224189362f2b2cfd9fe4c54af198cde
2018-04-05 12:14:13 +01:00
Sorin Sbarnea 7fea75e6fb Enable cross testing with python-jenkins
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>
2018-04-04 18:32:55 +01:00
Sorin Sbarnea 831d497b85 tox: enable multiple py3x versions
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>
2018-02-23 11:19:22 +00:00
Sorin Sbarnea c0b3b021dc Improve test resiliency
Avoids occasional test executions failures
caused by leftover files on dev machine or
by preexisting configuration files.

Change-Id: Ia0ba29e2dda58c37410a6926cae3039e4ba3473e
2018-01-18 18:08:56 +00:00
Daniel Watkins 0cbcf2c710 Update tox.ini to run voting tests by default
When a developer runs `tox`, they should see the results which will be
voting in gerrit.

Change-Id: I4964b674a1317f454739ef69505c985dc323f845
2017-10-06 14:27:04 -04:00
Sorin Sbarnea 8a7d77c180 Removed some deprecation warnings and enabled py35 on tox.
Change-Id: Icc5b28c4636b542a10502b7b1d2d2dc2028cc166
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
2017-03-12 19:43:33 +00:00
Monty Taylor 503fd8dcd4
Sync requirements with openstack/requirements
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
2016-12-10 09:42:57 -06:00
Darragh Bailey e165b78546 Add comment about proxy env pass through
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
2016-09-15 11:33:35 +01:00
Wayne fc73cedb45 Introduce modular implementation of subcommands.
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
2016-07-08 09:55:44 -07:00
Darragh Bailey 31d5996192 Allow testing non-default configs with complex definitions
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
2016-05-26 15:37:23 +01:00
Darragh Bailey 3faecfd76a Add separate linkcheck env and allow dev to select builder
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
2016-01-11 13:06:17 +00:00
Ondřej Nový cc960d90fe Deprecated tox -downloadcache option removed
Caching is enabled by default from pip version 6.0

More info:
https://testrun.org/tox/latest/config.html#confval-downloadcache=path
https://pip.pypa.io/en/stable/reference/pip_install/#caching

Change-Id: If7209ed58d312bba35332e81a1943f55a286beed
2015-12-11 22:21:28 +01:00
Jenkins 01d210c5d3 Merge "Stop specifying requirements.txt in tox.ini" 2015-09-08 08:32:27 +00:00
Darragh Bailey 0c7273aeb8 Update tox with supported python versions
Change-Id: I2fc3d5a47a4d8e0bf8475475043e21cd3c4398b5
2015-08-25 18:39:10 +01:00
Khai Do a3bc00a4ab Stop specifying requirements.txt in tox.ini
As PBR already injects the contents of requirements.txt into
setup_requires, there is no need for tox to explicitly install them.
http://lists.openstack.org/pipermail/openstack-dev/2015-July/069663.html

Change-Id: I2f58dafdc2e4234e87c03c73a3c6c88ef659b564
2015-08-10 13:51:52 -07:00
Darragh Bailey 1898307ec0 Exclude .test directory from pep8 check
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
2015-07-07 16:43:24 +01:00
Clark Boylan b91cca3945 Test with LANG set to UTF-8
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
2015-05-20 08:11:12 -07:00
Monty Taylor 906eebb0e0 Rename doc environment to docs
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
2014-09-08 13:47:26 -07:00
Kevin L. Mitchell df37b9b7c7 Work around PYTHONHASHSEED-related problems
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
2014-08-22 18:01:23 -05:00
Marc Abramowitz b33ac74828 Add tox "coverage" target
Change-Id: I577d62e016a550ea30671837a0a426165984e982
2014-05-27 16:50:34 -07:00
James E. Blair 6067cc712c Add hacking to requirements
Solely for the transitive dependencies.  Ignore errors from hacking
as do the other openstack-infra python projects.

Change-Id: Ib5953c31a5380f9f57c7f79e1ce0699aef5eb629
2014-04-16 10:37:12 -07:00
Antoine Musso d2ff8c098f Migrate to pbr
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
2014-03-14 22:25:46 +01:00
Antoine Musso 5f96ad465b Use venv to build documentation
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
2014-03-02 10:56:40 +01:00
Jeremy Stanley 7acf012c2b Make sure tox does not call pip install with --pre
* 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
2013-09-18 19:34:24 +00:00
Paul Belanger 96211e74d6 Add python26 support
Change-Id: I1e4b388135ce73f34ba594943c4ae7e5f2dadeba
Signed-off-by: Paul Belanger <paul.belanger@polybeacon.com>
2013-07-19 23:29:29 -04:00
Antoine Musso b829874916 Tests for publishers
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>
2013-07-19 14:31:11 +02:00
Paul Belanger 345fb6e5e1 Bump pep8 to 1.3.3
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
2012-11-23 21:51:08 +00:00
Paul Belanger 0b9691ea02 Update tox to exclude *egg for pep8
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
2012-11-20 17:03:18 +00:00
Monty Taylor e4adf8fbcf Use console_scripts entrypoint.
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
2012-11-19 19:49:32 +00:00
James E. Blair ab7c6bc6c1 Add documentation.
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
2012-09-17 20:25:38 +00:00
James E. Blair f3f09c4f96 Simplify the xml test paths.
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
2012-09-05 18:51:14 +00:00
James E. Blair 0c2bef0803 Add test to determine whether XML output has changed.
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
2012-09-01 03:52:21 +00:00
James E. Blair fb0a113eff Add tox.ini and pep8, pyflakes cleanup.
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
2012-08-15 00:26:28 +00:00