Commit Graph

26 Commits

Author SHA1 Message Date
Guillaume DeMengin e1a086ad45 CI: add support to python 37 to 311
Change-Id: I48c411f9283fb941ba81181265f59974af649a46
2023-07-17 14:17:35 +00:00
Guillaume DeMengin b8fa41f85f Use multiprocess to avoid pickle errors in tox on macos
Closes-Bug: #1998146
Change-Id: Id3ccee0f2f6ffb86c67b222f4cb0a869ba8c6bda
2023-07-17 13:55:02 +02:00
Guillaume DeMengin 70dc3e4f71 Fix CI tests
Adjust some of the dependencies.

multi_key_dict is not shipped by OpenStack Zuul templates
`build-openstack-docs-pti` or `openstack-cover-jobs` we thus need to
depend on `requirements.txt`.

setuptools v66.0.0 removed support for PEP 440 non-conforming versions.
It provides pkg_resources which we use in PluginVersion.

Tox `whitelist_externals` has been renamed `allowlist_externals`.

Signed-off-by: Antoine Musso <hashar@free.fr>
Change-Id: Ie791c2bb0e7b3784913f45768d2f3db4c66ccae5
2023-03-16 21:06:36 +01:00
Kazuhiro Suzuki 36f0b89766 Blacklist stestr 3.0.0 and drop pypy
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

Drop pypy testing since pypy jobs are always failling.

Signed-off-by: Antoine Musso <hashar@free.fr>
Signed-off-by: Andreas Jaeger <aj@suse.com>
Change-Id: Ia2f7c814f21c78f29ec9024997469625f92bc401
2020-04-17 14:46:18 +02:00
K Jonathan Harker 0ab91c7a7c Remove pin on mock module
This was pinned for python26, which we no longer support.

Change-Id: I7dfd92c011b223d171ffd4be9c3f8c59fe87c6cf
2019-05-23 11:38:13 +00:00
Andreas Jaeger 748aa2068b Update jobs
The repo uses docs-on-read-the-docs, remove extra
build-openstack-sphinx gate job.

Without this change, two docs jobs would be building in gate, tox-docs
and build-sphinx. One is enough.

Also, use templates instead of individual jobs.

Import other templates from project-config, use the failing docs
template since readthedocs is not setup yet.

Remove publish-to-pypi, this should stay in project-config.

Fix sphinx requirements for python 3.

Fix decoding in failing test.

Change-Id: Ic4f715b45c1284ea49339e96c2aa87b2e81fcbea
2019-05-21 21:35:07 +02:00
Sorin Sbarnea e5e7a097b1
Adopt use of pre-commit hooks
- rename pep8 target to more generic linters
- migrates flake8 execution to pre-commit
- adds yaml linting
- hardening flake8 rules
- setting max-line-lengh to 120 instead of ignoring it.
- bumped minimal sphinx version
- configured sphinx with warnings as errors

Change-Id: I4c598c07297ae6a2160ba6754cec860adbfeb6f2
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
2018-06-22 13:37:30 +01:00
Sorin Sbarnea e391e92bad Revert "Do not require requests-kerberos for tests"
This reverts commit 1946ed303b.

Change-Id: If4b1db131af467eb9a0910584c0fdc08dcee10c6
2018-05-30 16:51:44 +00:00
Sorin Sbarnea ce56780909
Freeze cmd2 library on python2
The cmd2-0.9.0 is python3-only. Let's freeze the cmd2<0.9.0 as
recommended in https://pypi.org/project/cmd2/ while allowing any newer version on python 3+.

Change-Id: I5e631603e162da1d93347f954c9bc1af3f69597c
2018-05-30 17:03:24 +01:00
Jan Hruban 1946ed303b Do not require requests-kerberos for tests
The test for kerberos was dropped in
34cca0c4d9, as it was not needed for the
simpler implementation with requests. Let's drop the requests-kerberos
from test dependencies as well, as it has only caused troubles in other
tests - at least for me.

One had to set jenkins.requests_kerberos to None, as was done in the
tests.base.JenkinsTestBase. In places where it was not set to None, the
jenkins.Jenkins.jenkins_open tried the kerberos authentication in
addition to anonymous authentication on the /api/json endpoint.

This was the case for
  tests.test_jenkins_sockets.JenkinsRequestTimeoutTests.test_jenkins_open_timeout
where it has resulted in a different exception than was expected:

  Traceback (most recent call last):
    File "tests/test_jenkins_sockets.py", line 31, in test_jenkins_open_timeout
      j.jenkins_open(request, add_crumb=False)
    File "jenkins/__init__.py", line 533, in jenkins_open
      return self.jenkins_request(req, add_crumb, resolve_auth).text
    File "jenkins/__init__.py", line 547, in jenkins_request
      self._maybe_add_auth()
    File "jenkins/__init__.py", line 384, in _maybe_add_auth
      % '\n'.join(failures))
  jenkins.JenkinsException: Unable to authenticate with any scheme:
  auth(kerberos) Error in request: HTTPConnectionPool(host='127.0.0.1', port=33921): Read timed out. (read timeout=0.1)
  auth(anonymous) Error in request: HTTPConnectionPool(host='127.0.0.1', port=33921): Read timed out. (read timeout=0.1)

Change-Id: I45cbb3a666ee6a9ecbe628ca8b7f0b07dcfcb0eb
2018-05-11 22:24:36 +02:00
Sorin Sbarnea 9f143f1241 Replace testr with stestr
Switch to use stestr which is maintained as opposed
to testrepository (testr) which became a defunct project.

Change-Id: If53c985b6cf3b4122596f09ec4d0ec4a186688b8
2018-04-04 23:25:21 +01:00
Darragh Bailey 34cca0c4d9 Migration to using requests
Convert to the requests library to allow for more sophisticated response
handling to be added.

Want to allow for applications to override the response handling in
certain cases where the default is incorrect. Handling of urlopen
responses results in version specific handling to ensure correct
behaviour across multiple versions of python.

Changing to use the requests package, provides a higher level interface
and removes some of the version specific handling for exceptions.

Change-Id: I5369a0d35be4bf8b3b197a51e60aba21b5742cc7
Depends-On: Iabd70aa457ceb4dbc147d7cbaeec913148cb3b56
2018-02-12 11:16:54 +00:00
Swapnil Kulkarni (coolsvap) ac0ca9fbf4 Remove discover from test-requirements
It's only needed for python < 2.7 which is not supported

Change-Id: I8364eaa7b8b6189f8c0545d30697d40823e1b050
2016-07-22 04:02:12 +00:00
Lukas Vacek 4152a0138b Add optional kerberos support
Check if "kerberos" package can be imported at runtime
(in __init__.py).  If not, everything works as before.
If "kerberos" package can be imported register a new
urllib handler (defined in urllib_kerb.py) which adds
support for kerberos auth.

This urllib handler (urllib_kerb.py) is only triggered
on 401 (Unauthorized) response, and we try to auth
with kerberos. If unsuccessful, next 401 handler (if any)
is triggered.

Change-Id: I1a47e455aa14535a124df950994718a11d7e4f57
2016-01-27 23:08:04 +01:00
Darragh Bailey 8b3023dc18 Provider helper classes for plugin data management
Add some common management and version comparison capabilities via
dedicated classes to simplify how calling libraries can perform version
checks on the installed plugins.

Update the comments on the existing methods to note that they return the
raw plugin data in JSON format instead of the parsed local objects.

Change-Id: If43bb945f55c6fb9f8a6595091eace12e4630ffa
2015-09-28 18:15:57 +01:00
Jerome Hourquebie 7267eec454 Adds Cloudbees folder plugin support
This patch adds cloudbees folder plugin support. Folder should be
specified in job name : <folder>/<job>

This update also extend job_builder
(http://ci.openstack.org/jenkins-job-builder/) tool without any
modification.

Change-Id: I6d3957c217e1253e53152d90d5fcce5e69c77674
Co-Authored-By: Darragh Bailey <daragh.bailey@gmail.com>
2015-09-21 18:25:35 +01:00
Darragh Bailey a8655eaccc Fix timeout function and add capturing of messages on failure
Ensure process terminate is only called after checking whether the
process is still running so as not to accidentally set an exitcode.
Additionally include improved message exchange and capturing to allow
for easier debug should the expected exceptions not appear on socket
timeouts.

Change-Id: Ic51745ffa67570e9a3ca4574d2bfc54d0cd6724b
2015-08-17 18:09:19 +01:00
Darragh Bailey d47b37d07d Fix tests on python 2.6 and mark as deprecated
Pin mock to < 1.1 as newer versions no longer work on python 2.6.
Remove duplicate unittest2 for python 2.6 test env.
Adding warning to mark python 2.6 support as deprecated and intended to
be removed.

Testtools re-added the requirement for unittest2 so the separate
dependency for python 2.6 created a duplicate error that causes tox
to fail.

Change-Id: Ia79eeeb5d2432cf1025631a1722de5fb1babe2c9
2015-07-13 18:36:12 +01:00
Emilien Macchi ecd79af18b requirements: pin pbr>=0.8.2,<2.0
This patch aims to pin pbr>=0.8.2,<2.0 instead of pbr>=0.8.2,<1.0.
To do that, we also need to update test-requirements.txt to pin hacking
to <0.11 (like in current Global OpenStack requirements).
We also need to ignore some hacking rules.

Some distros ship 1.0.1 so it conflicts with the version in
requirements.

Change-Id: I3620c5fe72e49e226f2f5d1e6c36179eb053f424
2015-06-09 18:24:53 -04:00
Khai Do b501703ff3 testtools requires unittest2
It seems like testtools requires unittest2 now so we need to add it to
the requirements.

Error I got when ran 'tox -epy27' in fresh env:

  Running setup.py install for testtools
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/Users/khaido/PycharmProjects/python-jenkins/.tox/py27/build/testtools/setup.py", line 10, in <module>
        import testtools
      File "testtools/__init__.py", line 69, in <module>
        from testtools.testcase import (
      File "testtools/testcase.py", line 28, in <module>
        import unittest2 as unittest
    ImportError: No module named unittest2
    Complete output from command /Users/khaido/PycharmProjects/python-jenkins/.tox/py27/bin/python -c "import setuptools;__file__='/Users/khaido/PycharmProjects/python-jenkins/.tox/py27/build/testtools/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/5d/t1_1wr6n1_gg_jwnl8qx2fqm0000gn/T/pip-Lya9W8-record/install-record.txt --single-version-externally-managed --install-headers /Users/khaido/PycharmProjects/python-jenkins/.tox/py27/include/site/python2.7:
    Traceback (most recent call last):

Change-Id: I060f0ff36cec915c86cfaf6277af89fb8d9ea58e
2015-01-12 11:24:23 -08:00
Clark Boylan aa16b89bdf Six is a runtime requirement not a test req
Six needs to be installed when python-jenkins is installed. By default
test-requirements are only installed when running tests. Six was listed
as a test-requirement so it was not installed when pip installing
python-jenkins. Make six a regular requirement so that it is installed
properly every time.

Change-Id: I2b7cb7e967b20ee0e06fe4c665f08c5932e524f2
2014-07-09 14:09:52 -07:00
Marc Abramowitz 129fd8ca3c Use pbr, pep8 checks & fixes, add "doc" tox target
Change-Id: I1f01e4e5407a8216c7c867c143d15db2037e16d6
2014-07-02 14:12:31 -07:00
Marc Abramowitz 5d7ecd43e0 Make it work on Python 3
Change-Id: Ia8eedf699e988a199520c48e21c9731af912003c
2014-05-21 22:49:34 -07:00
Marc Abramowitz 9424023180 100% test coverage
Change-Id: Ie035a299a2f92eede9a88c00e4dc4ad820fbc710
2014-05-21 22:35:32 -07:00
Marc Abramowitz 8d38dfefd2 Add support for measuring coverage
Change-Id: I219e14658c025fa13f3e0f8ba9dc6945ce777120
2014-05-21 08:25:09 -07:00
Antoine Musso 5269924155 Wrap tests and linting with tox
Use tox configuration to expose linting and unit testing. Will let us
integrate them with OpenStack continuous integration infrastructure.

* updates .gitignore following the migration from bzr
* get rid of the old Makefile in favor of tox
* remove .pep8 file (that is now a [flake8] section in tox.ini)
* fix a few trivial pep8 errors (comments must start with '# ' and
  modulo operator needs surrounding spaces) but ignore 'line too long
  (E501)' for now.
* write module requirements in /test-requirements.txt. Discover is
  needed for python 2.6.
* change the test command that cames from the Makefile so it works with
  python 2.6

Change-Id: If58730d84315c0ea018a3757624d98bf2e1aeb3f
2014-04-30 22:37:19 +02:00