Fix unittests for python2 and fedora

We need to pin enum34 on python2 because upstream broke it.

Also, we should not install zuul in python2, because it's not targetted
at python2. It's only here so that linters can deal with zuul_return
and other things from its library, so it should be fine to not install
it for python2 unittests.

GitPython was in here as a pin to the versions that support python3
for zuul. Since we're constraining zuul to only python3, we don't need
to mention GitPython at all.

Update the siblings unit test to use requests as the package we expect
to be already installed since we're no longer installing zuul for
python2.

Fedora 29 got archived upstream:

  http://mirror.sjc1.vexxhost.openstack.org/fedora/releases/29/README

So we need to switch to fedora 30.

Change-Id: I69e0b03f624ba45889916f89c0912df667aaf096
This commit is contained in:
Monty Taylor 2020-02-22 10:37:04 -06:00
parent 22b0ed2c4d
commit d36ba50765
6 changed files with 28 additions and 28 deletions

View File

@ -1,2 +1,2 @@
zuul===3.12.0 requests===2.18.4
doesnotexistonpypi===0.0.1 doesnotexistonpypi===0.0.1

View File

@ -33,10 +33,10 @@ class TestToxInstallSiblingPackages(testtools.TestCase):
# unit tests instead of mocking up everything. # unit tests instead of mocking up everything.
pkgs = get_installed_packages(sys.executable) pkgs = get_installed_packages(sys.executable)
# NOTE(mnaser): Zuul should be installed in this virtualenv # NOTE(mnaser): requests should be installed in this virtualenv
# but this might fail later if we stop adding Zuul # but this might fail later if we stop adding requests
# in the unit tests. # in the unit tests.
self.assertIn("zuul", pkgs) self.assertIn("requests", pkgs)
def test_write_new_constraints_file(self): def test_write_new_constraints_file(self):
# NOTE(mnaser): Given that we run our tests inside Tox, we can # NOTE(mnaser): Given that we run our tests inside Tox, we can
@ -44,8 +44,8 @@ class TestToxInstallSiblingPackages(testtools.TestCase):
# unit tests instead of mocking up everything. # unit tests instead of mocking up everything.
pkgs = get_installed_packages(sys.executable) pkgs = get_installed_packages(sys.executable)
# NOTE(mnaser): Zuul should be installed in this virtualenv # NOTE(mnaser): requests should be installed in this virtualenv
# but this might fail later if we stop adding Zuul # but this might fail later if we stop adding requests
# in the unit tests. # in the unit tests.
test_constraints = os.path.join(os.path.dirname(__file__), test_constraints = os.path.join(os.path.dirname(__file__),
'test-constraints.txt') 'test-constraints.txt')
@ -59,5 +59,5 @@ class TestToxInstallSiblingPackages(testtools.TestCase):
self.assertTrue(os.path.exists(constraints)) self.assertTrue(os.path.exists(constraints))
with open(constraints) as f: with open(constraints) as f:
s = f.read() s = f.read()
self.assertNotIn("zuul", s) self.assertNotIn("requests", s)
self.assertIn("doesnotexistonpypi", s) self.assertIn("doesnotexistonpypi", s)

View File

@ -2,8 +2,8 @@
# of appearance. Changing the order has an impact on the overall integration # of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later. # process, which may cause wedges in the gate later.
flake8 flake8
GitPython>=2.1.8,<2.1.12 enum34==1.1.6; python_version < "3.4"
zuul zuul; python_version > "3"
# We need to pin the ansible version directly here; per the # We need to pin the ansible version directly here; per the
# deprecation policy it should trail the version used by Zuul by 4 # deprecation policy it should trail the version used by Zuul by 4

View File

@ -32,7 +32,7 @@ PLATFORMS = [
'centos-7', 'centos-7',
'centos-8', 'centos-8',
'debian-stretch', 'debian-stretch',
'fedora-29', 'fedora-30',
'gentoo-17-0-systemd', 'gentoo-17-0-systemd',
'opensuse-15', 'opensuse-15',
'opensuse-tumbleweed', 'opensuse-tumbleweed',

View File

@ -37,13 +37,13 @@
label: debian-stretch label: debian-stretch
- job: - job:
name: zuul-jobs-test-install-docker-fedora-29 name: zuul-jobs-test-install-docker-fedora-30
description: Tests install-docker role on fedora-29 description: Tests install-docker role on fedora-30
parent: zuul-jobs-test-install-docker parent: zuul-jobs-test-install-docker
nodeset: nodeset:
nodes: nodes:
- name: fedora-29 - name: fedora-30
label: fedora-29 label: fedora-30
- job: - job:
name: zuul-jobs-test-install-docker-ubuntu-bionic name: zuul-jobs-test-install-docker-ubuntu-bionic
@ -281,7 +281,7 @@
- zuul-jobs-test-install-docker-centos-7 - zuul-jobs-test-install-docker-centos-7
- zuul-jobs-test-install-docker-centos-8-nv - zuul-jobs-test-install-docker-centos-8-nv
- zuul-jobs-test-install-docker-debian-stretch - zuul-jobs-test-install-docker-debian-stretch
- zuul-jobs-test-install-docker-fedora-29 - zuul-jobs-test-install-docker-fedora-30
- zuul-jobs-test-install-docker-ubuntu-bionic - zuul-jobs-test-install-docker-ubuntu-bionic
- zuul-jobs-test-install-docker-ubuntu-xenial - zuul-jobs-test-install-docker-ubuntu-xenial
- zuul-jobs-test-registry-docker - zuul-jobs-test-registry-docker
@ -297,7 +297,7 @@
jobs: jobs:
- zuul-jobs-test-install-docker-centos-7 - zuul-jobs-test-install-docker-centos-7
- zuul-jobs-test-install-docker-debian-stretch - zuul-jobs-test-install-docker-debian-stretch
- zuul-jobs-test-install-docker-fedora-29 - zuul-jobs-test-install-docker-fedora-30
- zuul-jobs-test-install-docker-ubuntu-bionic - zuul-jobs-test-install-docker-ubuntu-bionic
- zuul-jobs-test-install-docker-ubuntu-xenial - zuul-jobs-test-install-docker-ubuntu-xenial
- zuul-jobs-test-registry-docker - zuul-jobs-test-registry-docker

View File

@ -155,14 +155,14 @@
label: debian-stretch label: debian-stretch
- job: - job:
name: zuul-jobs-test-base-roles-fedora-29 name: zuul-jobs-test-base-roles-fedora-30
description: Tests roles in the 'base' job on fedora-29 description: Tests roles in the 'base' job on fedora-30
parent: zuul-jobs-test-base-roles parent: zuul-jobs-test-base-roles
tags: auto-generated tags: auto-generated
nodeset: nodeset:
nodes: nodes:
- name: fedora-29 - name: fedora-30
label: fedora-29 label: fedora-30
- job: - job:
name: zuul-jobs-test-base-roles-gentoo-17-0-systemd name: zuul-jobs-test-base-roles-gentoo-17-0-systemd
@ -339,16 +339,16 @@
- secondary - secondary
- job: - job:
name: zuul-jobs-test-multinode-roles-fedora-29 name: zuul-jobs-test-multinode-roles-fedora-30
description: Tests multinode setup roles on fedora-29 description: Tests multinode setup roles on fedora-30
parent: zuul-jobs-test-multinode-roles parent: zuul-jobs-test-multinode-roles
tags: auto-generated tags: auto-generated
nodeset: nodeset:
nodes: nodes:
- name: primary - name: primary
label: fedora-29 label: fedora-30
- name: secondary - name: secondary
label: fedora-29 label: fedora-30
groups: groups:
- name: switch - name: switch
nodes: nodes:
@ -483,7 +483,7 @@
- zuul-jobs-test-base-roles-centos-7 - zuul-jobs-test-base-roles-centos-7
- zuul-jobs-test-base-roles-centos-8 - zuul-jobs-test-base-roles-centos-8
- zuul-jobs-test-base-roles-debian-stretch - zuul-jobs-test-base-roles-debian-stretch
- zuul-jobs-test-base-roles-fedora-29 - zuul-jobs-test-base-roles-fedora-30
- zuul-jobs-test-base-roles-gentoo-17-0-systemd - zuul-jobs-test-base-roles-gentoo-17-0-systemd
- zuul-jobs-test-base-roles-opensuse-15 - zuul-jobs-test-base-roles-opensuse-15
- zuul-jobs-test-base-roles-opensuse-tumbleweed-nv - zuul-jobs-test-base-roles-opensuse-tumbleweed-nv
@ -497,7 +497,7 @@
- zuul-jobs-test-multinode-roles-centos-7 - zuul-jobs-test-multinode-roles-centos-7
- zuul-jobs-test-multinode-roles-centos-8 - zuul-jobs-test-multinode-roles-centos-8
- zuul-jobs-test-multinode-roles-debian-stretch - zuul-jobs-test-multinode-roles-debian-stretch
- zuul-jobs-test-multinode-roles-fedora-29 - zuul-jobs-test-multinode-roles-fedora-30
- zuul-jobs-test-multinode-roles-gentoo-17-0-systemd - zuul-jobs-test-multinode-roles-gentoo-17-0-systemd
- zuul-jobs-test-multinode-roles-opensuse-15 - zuul-jobs-test-multinode-roles-opensuse-15
- zuul-jobs-test-multinode-roles-opensuse-tumbleweed-nv - zuul-jobs-test-multinode-roles-opensuse-tumbleweed-nv
@ -513,7 +513,7 @@
- zuul-jobs-test-base-roles-centos-7 - zuul-jobs-test-base-roles-centos-7
- zuul-jobs-test-base-roles-centos-8 - zuul-jobs-test-base-roles-centos-8
- zuul-jobs-test-base-roles-debian-stretch - zuul-jobs-test-base-roles-debian-stretch
- zuul-jobs-test-base-roles-fedora-29 - zuul-jobs-test-base-roles-fedora-30
- zuul-jobs-test-base-roles-gentoo-17-0-systemd - zuul-jobs-test-base-roles-gentoo-17-0-systemd
- zuul-jobs-test-base-roles-opensuse-15 - zuul-jobs-test-base-roles-opensuse-15
- zuul-jobs-test-base-roles-ubuntu-bionic - zuul-jobs-test-base-roles-ubuntu-bionic
@ -526,7 +526,7 @@
- zuul-jobs-test-multinode-roles-centos-7 - zuul-jobs-test-multinode-roles-centos-7
- zuul-jobs-test-multinode-roles-centos-8 - zuul-jobs-test-multinode-roles-centos-8
- zuul-jobs-test-multinode-roles-debian-stretch - zuul-jobs-test-multinode-roles-debian-stretch
- zuul-jobs-test-multinode-roles-fedora-29 - zuul-jobs-test-multinode-roles-fedora-30
- zuul-jobs-test-multinode-roles-gentoo-17-0-systemd - zuul-jobs-test-multinode-roles-gentoo-17-0-systemd
- zuul-jobs-test-multinode-roles-opensuse-15 - zuul-jobs-test-multinode-roles-opensuse-15
- zuul-jobs-test-multinode-roles-ubuntu-bionic - zuul-jobs-test-multinode-roles-ubuntu-bionic