Commit Graph

39 Commits

Author SHA1 Message Date
Clark Boylan 12a0aca425 Switch from tox to nox
Recent tox releases have put us on a config treadmill. Avoid these
issues entirely by using nox. Nox is a tox alternative that uses
standard tools like pip and should be simpler to use for us.

Change-Id: Ie79845bbed7ca1254aec466bd5219186fefcdac9
2023-03-13 10:19:07 -07:00
Jeremy Stanley 4c6ab44916 Upgrade testing to Gerrit 3.4.4
An addition has been proposed to leverage Gerrit's "Cc" feature, but
in order to test this we need a newer version of the server.

Newer Gerrit versions require HTTP basic auth instead of digest for
the REST API, so switch our tests to use that when uploading SSH
keys.

A newer JDK (11) is required, but this version should still be
available on our configured test platforms.

We update the test Gerrit server config to not try to send email. This
prevents annoying tracebacks from ending up in the Gerrit logs on test
failures.

We update test_cloned_repo and test_multiple_changes to look for strings
that newer Gerrit emits on successful push. Git review passes these
through to users and the tests look for them to determine if pushes were
successful.

Because of an SSH host key negotiation regression in 3.4.5, stick
with 3.4.4 for now:

https://bugs.chromium.org/p/gerrit/issues/detail?id=16215

Finally we remove skipsdist from tox.ini so that `which git-review` can
find git-review installed to the test venv. Tox v4 won't install the
project into the venv if skipsdist is set.

Change-Id: I540950b93356b1efbc34bca976bfb3134f47a599
2023-03-07 15:56:59 -08:00
Clark Boylan ef1a35f4e1 Install PBR explicitly
We do this because easy_install on python3.5 is failing to find pbr. I
believe this is happening due to pypi's deprecation of non SNI tls
connections. They report that the version of 3.5 on xenial should be
able to do SNI but easy_install at least doesn't seem to do so.

Note we restrict this to python>=3 and <=3.5 as python 2.7 had
backported fixes. Also, this really only helps with unittesting via tox
as we instruct tox to explicitly install the requirements files before
creating/installing the package itself. This is the reason we stick this
in test-requirements.txt rather than requirements.txt.

Change-Id: Iac2c1f4f575de250ed0dba22d33b017322fd7562
2021-04-23 10:42:35 -07:00
Jeremy Stanley 319953d5ab Overhaul Python package metadata and OpenDev URLs
Modernize our package metadata in the following ways:

* switch from description-file to long_description with the file
  attribute, and specify an explicit content type and encoding

* replace the home-page parameter with the newer general url one

* add specific labelled project links for improved navigation from
  PyPI's summary sidebar

* add commandline keyword to help folks searching

* use the specific license metadata in addition to the corresponding
  trove classifier for it

* make sure wheels when built also incorporate the LICENSE and
  AUTHORS files so that we're not distributing them without a copy
  of the license text

* stop flagging wheels as "universal" now that git-review no longer
  supports Python 2.7

* drop the old Sphinx integration config for PBR now that it's no
  longer needed

https://setuptools.readthedocs.io/en/latest/userguide/declarative_config.html

Also update old openstack.org URLs throughout contributor docs and
examples/comments to newer opendev.org counterparts. Remove the old
redundant HACKING.rst file as well as a lingering MANIFEST.in from
the times before PBR was a thing. Replace the CONTRIBUTING.rst with
a shorter one cribbed from bindep. Add the test profile to the one
entry in bindep.txt to make it more apparent that's not a runtime
dependency of git-review. Adjust some old "OpenStack, LLC."
copyrights as indicated by the foundation's "Legal Issues FAQ."

Change-Id: Ie45d4d73ba7b5a860f09cc4f1d849587761d846c
2021-02-26 20:45:24 +00:00
Jeremy Stanley 5d93035d10 Test/assert Python 3.9 support
Update our package metadata and job list to include Python 3.9.

Change-Id: I931b1bf6e41b2d18d56a9b841ac8eda501093628
2021-02-24 01:00:12 +00:00
Sorin Sbarnea 4af1703a90 Assure git-review works with py37 and py38
Change-Id: I0e7b370348e4a350d4e2fdc11bc57c3746f15267
2021-01-13 15:49:58 +00:00
Sorin Sbarnea 3757503895 Drop support for py27
Officially removes support for py27, which was already broken for
3+ months (unmaintained test tools).

Change-Id: I38c966d4e1680592f5cd94695051710695d41f71
Related: https://github.com/testing-cabal/subunit/pull/32
2021-01-13 14:10:31 +00:00
Sorin Sbarnea f4e0e70bb0 Bring zuul configuration in-tree
Change-Id: I42dd5b0e1a5ac5a83f4370790ada9617f1122f6b
Depends-On: https://review.opendev.org/c/openstack/project-config/+/763808
2021-01-13 13:16:27 +00:00
Stephen Finucane 5afa906ef5 tox: Use python3 for all testenvs
Change-Id: I8ec8c65be8448b49ed915262c9026281958e982a
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2020-01-16 15:15:28 +00:00
Stephen Finucane ddbd0ba1d9 trivial: Update to hacking 2.x
Fixes an issue we're seeing in the python3-based gate plus some other
random things.

Change-Id: I417c0a7669090ee3419c406024f6f3e3289b4c4b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2020-01-16 15:12:58 +00:00
Adam Spiers 7db7d017b2 Build docs using Python 3
The docs testenv in tox.ini was attempting to use Python 2.7.x with
Sphinx 2.x, which is not a compatible combination.  This caused tox
failures like this:

  2019-05-08 12:45:48.060953 | TASK [tox : Run tox without tests]
  2019-05-08 12:45:48.759277 | ubuntu-bionic | docs create: /home/zuul/src/opendev.org/openstack/os-resource-classes/.tox/docs
  2019-05-08 12:45:52.775007 | ubuntu-bionic | docs installdeps: -r/home/zuul/src/opendev.org/openstack/os-resource-classes/doc/requirements.txt
  2019-05-08 12:45:53.838450 | ubuntu-bionic | ERROR: invocation failed (exit code 1), logfile: /home/zuul/src/opendev.org/openstack/os-resource-classes/.tox/docs/log/docs-1.log
  2019-05-08 12:45:53.838669 | ubuntu-bionic | ================================== log start ===================================
  2019-05-08 12:45:53.838995 | ubuntu-bionic | DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
  2019-05-08 12:45:53.839207 | ubuntu-bionic | Looking in indexes: http://mirror.iad.rax.openstack.org/pypi/simple, http://mirror.iad.rax.openstack.org/wheel/ubuntu-18.04-x86_64
  2019-05-08 12:45:53.839421 | ubuntu-bionic | Collecting sphinx!=1.6.6,!=1.6.7,>=1.6.2 (from -r /home/zuul/src/opendev.org/openstack/os-resource-classes/doc/requirements.txt (line 1))
  2019-05-08 12:45:53.839619 | ubuntu-bionic |   Downloading http://mirror.iad.rax.openstack.org/wheel/ubuntu-18.04-x86_64/sphinx/Sphinx-2.0.1-py2.py3-none-any.whl (3.2MB)
  2019-05-08 12:45:53.839749 | ubuntu-bionic | ERROR: Sphinx requires Python '>=3.5' but the running Python is 2.7.15
  2019-05-08 12:45:53.839778 | ubuntu-bionic |
  2019-05-08 12:45:53.839912 | ubuntu-bionic | =================================== log end ====================================
  2019-05-08 12:45:53.840347 | ubuntu-bionic | ERROR: could not install deps [-r/home/zuul/src/opendev.org/openstack/os-resource-classes/doc/requirements.txt]; v = InvocationError(u'/home/zuul/src/opendev.org/openstack/os-resource-classes/.tox/docs/bin/pip install -r/home/zuul/src/opendev.org/openstack/os-resource-classes/doc/requirements.txt', 1)

So switch to Python 3 for building docs.

Change-Id: If04bd7cf8c316f3ae621c182a05aebc779b4d5b4
2019-05-28 13:46:59 +01:00
Sorin Sbarnea 514958d3f3 Switch from testrepository to stestr
Adopts use of newer stestr for running the test suite.

Passing TERM is needed or stestr will ignore the --color option when
run under tox.

Change-Id: Id2d4ce36cdfedd5a847e0428854753d2cf4140ee
2019-02-12 09:58:46 +00:00
Sorin Sbarnea e535d4467e Allow user to control Java version used by tox
This allows user to define JAVA_HOME in order to control which version
of Java will be used by Gerrit during tox testing.

Avoid Gerrit startup failure due to use of wrong version of Java,
even if `java -version` would have reported the right version.

On systems with multiple versions of Java 8/9/10 it was impossible to
run tox because the launcher would have always picked the latest
version which is clearly not compatible with Gerrit war archive used
for testing.

In the future we will start using a gerrit container for testing and
avoid dependency on local Java version.

Change-Id: I05b6f7125393a009e1fdcf556b17df158c10eea0
2019-01-29 17:36:28 +00:00
Marc Herbert 205859c788 tox.ini: add passenv = http_proxy https_proxy # _JAVA_OPTIONS
Add: 'passenv = http_proxy https_proxy' whitelist to tox.ini because there's
basically never any good reason to throw away proxy configuration.

The addition of http_proxy allows downloading
http://tarballs.openstack.org/ci/gerrit/gerrit-<version>.war
behind a proxy.

https_proxy is not needed right now but added for consistency and
"future-proofing"

_JAVA_OPTIONS is added but only as a clue and commented out by default
because it could hold non-proxy configuration which would defeat tox'
environment cleaning and introduce test variability.

This is just the tox.ini source code part of the larger
I764ed51314c8e2d0572d1f01c9792bee0a40c7e6
includes documentation of workarounds and troubleshooting tips.

Change-Id: I764ed51314c8e2d0572d1f01c9792bee0a40c7e7
2018-12-11 13:29:35 -08:00
Stephen Finucane 197a2de8a7 tox: Remove dead settings/targets
The sdist target is useless given that releases are automated.
Similarly, the '[testenv] install_command' uses the default value and is
therefore not required. Finally, some other things were slightly off or
otherwise annoying and can be fixed.

Change-Id: Ia029aba9ee5bc79cf39043a5fcaf9463aa1518f7
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2018-10-15 15:02:27 +01:00
Monty Taylor 8236cdbf37 Use doc/requirements and openstackdocstheme
oslosphinx is the old hotness. openstackdocstheme is the new hotness.
Also, we can use doc/requirements.txt for docs requirements.

Change-Id: I9cbc670c8fb065d240251f061919479c87193ff5
2018-08-28 15:13:00 -07:00
Monty Taylor c9282ae021
Update tox docs environment to use sphinx-build
We've been moving to running sphinx-build directly instead of python
setup.py build_sphin.

Change-Id: Ic847b5911aa7499033e879ffe6c1cac4d9c9f80e
2018-08-20 10:38:15 -05:00
Sorin Sbarnea de0d27144e
tox: default envlist to supported python versions
- Removes py26,py32,py33 due EOL
- Added missing py36,py36,py37

Change-Id: I365c11decab680d3c7d3bfdd1b7328cb7efb3a1a
2018-07-17 14:50:32 +01:00
Yuriy Taraday 33081ce1d6 Use hash of test ID to pick Gerrit ports in tests
This eliminates need for 127.* IPs mapped to loopback interface (which
is true only for Linux) and makes test site generation even more
predictable (name of site dir for a test is the same on any machine).

Hash function used is md5(test_id) % 10000 which is enough for now. This
function is checked for collisions before every run in tox.ini, so if
someone happens to add test that will cause a collision, it'll be
immediately visible. Hash function can be changed to anything else that
maps test ID string to a number in [0,10000].

Change-Id: Ib05d9b489a80e4f55c84db2f8bea20b88e959649
2016-08-15 17:41:30 +01:00
Jeremy Stanley 55a91a6655 Fix H238 violation and enable check for that rule
Change-Id: I04f3d96acfc0be12393cc6cf5f0d3f7006939532
2015-06-17 00:53:01 +00:00
Jeremy Stanley 7a4f2553d6 Update to newer hacking checks
Update to newer hacking checks, and temporarily disable H238 to be
fixed in a subsequent patch.

Change-Id: I7d59ca5680f958852f73e705e45454a1c4d1c800
2015-06-17 00:49:19 +00:00
Doug Hellmann b6aab6d9d6 Split README.rst into separate doc files
Split up the README into separate documentation files so we can publish
the documentation for git-review.

Change-Id: Idcdf43e73c5ca5b8cb239606236e3b2a660c46b7
2015-02-03 17:38:50 +01:00
Jeremy Stanley 213f99515c Work toward Python 3.4 support and testing
Change-Id: Ie5b0ac8763a0d137e0aa99b05102d2aa76f60034
2014-09-03 19:00:09 +00:00
Christian Berendt d3b91e326e Enabled hacking checks H305 and H307
* H305  imports not grouped correctly
* H307  like imports should be grouped together

Change-Id: Ia4b376a90fed830ceea4b91caa920ff38263df5e
2014-07-17 09:38:36 +02:00
Jeremy Stanley 59e7414d2a Update requirements to OpenStack's recommendations
This synchronizes requirements.txt, test-requirements.txt and
setup.py with the current state of the openstack/requirements
global-requirements.txt list. Also adds flake8 exclusions to tox.ini
for new hacking rules with which git-review does not yet comply.

Change-Id: I837ba57134bea16dd46c3f512bccd51cb39f76c8
2014-07-03 14:54:14 +00:00
Clark Boylan a4a7f3c491 Reduce testr concurrnecy to 2.
Hard set testr concurrency to 2 so that fewer gerrit instances are
started in parallel compared to the default testr concurrency setting.
This will help avoid contention for memory and process resources when
running the tests.

Change-Id: Id3837500ce243af8d8ef762c6dcf50146876f406
2014-02-14 13:13:54 -08:00
Jeremy Stanley 8fd1a948c3 Remove tox locale overrides
* tox.ini: The LANG, LANGUAGE and LC_ALL environment overrides were
introduced originally during the testr migration in an attempt to be
conservative about the possibility that locale settings in the
calling environment could cause consistency problems for test runs.
In actuality, this should be unnecessary and any place where it does
cause issues ought to be considered an actual bug. Also, having
these in the configuration actively causes older pip to have
problems with non-ASCII content in some package metadata files under
Python 3, so drop it now.

Change-Id: I8747a52141321549c56214710b70c5838aacc84e
Closes-Bug: #1277495
2014-02-10 03:02:11 +00:00
Dina Belova e99aa8b16d Implement integration tests.
Provide intergation testing for the git-review utility. Requires
Gerrit war file (like 2.6.1-gerrit.war) in the .gerrit directory in
the git-review project (like git-review/.gerrit/2.6.1-gerrit.war).

Tests start local Gerrit and create test user and project there to
be used.

Closes-Bug: 1048724
Change-Id: I3242479dcbcf230085178004540992680f3f8e30
2013-08-15 21:08:08 +00:00
Dina Belova d73c473b19 Migrate to pbr.
For ease of future source code maintenance by OpenStack developers,
git-review is now adopting the same Python Build Reasonableness as
used by current OpenStack projects.

Closes-Bug: 1179007
Change-Id: I20427b51e84b90dcc1d870a547cdcc5240b4ff0e
2013-08-15 20:42:37 +00:00
Jeremy Stanley 08f878bc02 Pin hacking <0.6
* tox.ini: Newer hacking fails to recognize the Apache header in the
git-review script, so pin at <0.6 for now to match an upcoming
refactoring change. This will allow us to get some quick cosmetic
fixes in first.

Change-Id: I8e92b1d23d0b8d87e3bafe43d97c987abdf1d9f8
2013-08-08 05:00:16 +00:00
Jeremy Stanley 8cebdcdb12 Fix pep8 deps for pyflakes version conflict.
Fixes bug 1199400.

* tox.ini: In the pep8 environment, flake8 and hacking were both
listed as deps. This was fine while both worked with the latest
pyflakes, but then pyflakes 0.7.3 came along and was getting
installed before the more explicit pyflakes 0.7.2 requirement was
parsed for hacking. Since flake8 is in the requirements list for
hacking anyway, this just removes it from the pep8 environment deps
list.

Change-Id: I647235a4f6d109e00f13a156c57ff3a0e9a13a81
2013-07-09 15:08:51 +00:00
Clark Boylan e131460c82 Add venv testenv to tox.ini.
The automagic pypi publishing of releases through jenkins.openstack.org
depends on tox having a testenv called venv. Add this new testenv so
that git-review can be released automagically.

Change-Id: I89d78a22c13f94b5af3cda1115c8068424d42b34
2013-04-05 13:45:29 -07:00
Monty Taylor a221915447 Align to OpenStack Hacking guidelines.
Change-Id: I8eeea3be46d4943c462772de26b10142f426a00c
2013-04-04 16:22:14 -07:00
Monty Taylor 3be868a923 Switch to flake8 from pep8.
Change-Id: Ib7e1e51e644dbdfc530a7c5ca3005dd73ffa3f79
2013-04-04 16:22:14 -07:00
James E. Blair a4b99206bf Revert to 1.17.
1.17 was the last version that met the basic criteria of helping
first time developers sucessfully make their first commit.  That's
the most important task of git-review.  Revert all changes since
that version.  Unfortunately, some of the minor bug fixes since then
will have to be re-written because 1.18, in addition to introducing
basic bugs, also introduced significant code reorganization.

Addresses bug 1038269.

Re-fixed pep8 errors since we've become more strict since 1.17.

Change-Id: Ia3495a6bb883ddf08155c6bfb69a58d19a15a804
2012-09-30 16:39:08 -07:00
Clark Boylan b0e75ededd Configure a pep8 tox environment.
Configure a pep8 tox environment so that git-review can make use of the
standard OpenStack pep8 test job.

Change-Id: I4d655a6fc86bbbf6b594b7b35570e75951aef7ab
2012-09-27 14:29:29 -07:00
Mark McLoughlin ea5ed21d73 Fix pep8 errors with 1.3.1
Also, pin to 1.3.1 so that we don't break as soon as the next
pep8 version comes out.

Change-Id: Ic9d7f7c75e9140e607801728c55858c26cf56621
2012-06-25 21:58:59 +01:00
Monty Taylor 284871b691 Freeze requirements for sdist packages.
Use installed virtualenv to determine the list of actual
dependent versions tested.

Change-Id: Iff9781e97f32a318e357ae1d3305a74e2b3ba479
2012-01-27 15:37:44 -05:00
Monty Taylor 3cf55f98ac Added tox support for testing pep8.
We'll process requirements.txt to install depends as needed.
Also include a hacking doc explaining what we expect.
Also, including argparse automatically breaks our automagic version
numbering, so import it in main() (slightly evil, but not terrible)

Change-Id: Ib3f65459fe2cd54ce531b7ae22935e24bd8f8920
2012-01-26 18:55:10 -05:00