From d36ba507651067f1b6c0793a280b0ca3990e079e Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sat, 22 Feb 2020 10:37:04 -0600 Subject: [PATCH] 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 --- roles/tox/library/test-constraints.txt | 2 +- .../test_tox_install_sibling_packages.py | 12 +++++----- test-requirements.txt | 4 ++-- tools/update-test-platforms.py | 2 +- zuul-tests.d/container-roles-jobs.yaml | 12 +++++----- zuul-tests.d/general-roles-jobs.yaml | 24 +++++++++---------- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/roles/tox/library/test-constraints.txt b/roles/tox/library/test-constraints.txt index d2c6e43fe..10e67060f 100644 --- a/roles/tox/library/test-constraints.txt +++ b/roles/tox/library/test-constraints.txt @@ -1,2 +1,2 @@ -zuul===3.12.0 +requests===2.18.4 doesnotexistonpypi===0.0.1 diff --git a/roles/tox/library/test_tox_install_sibling_packages.py b/roles/tox/library/test_tox_install_sibling_packages.py index 8ab245c8f..b74697c36 100644 --- a/roles/tox/library/test_tox_install_sibling_packages.py +++ b/roles/tox/library/test_tox_install_sibling_packages.py @@ -33,10 +33,10 @@ class TestToxInstallSiblingPackages(testtools.TestCase): # unit tests instead of mocking up everything. pkgs = get_installed_packages(sys.executable) - # NOTE(mnaser): Zuul should be installed in this virtualenv - # but this might fail later if we stop adding Zuul + # NOTE(mnaser): requests should be installed in this virtualenv + # but this might fail later if we stop adding requests # in the unit tests. - self.assertIn("zuul", pkgs) + self.assertIn("requests", pkgs) def test_write_new_constraints_file(self): # 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. pkgs = get_installed_packages(sys.executable) - # NOTE(mnaser): Zuul should be installed in this virtualenv - # but this might fail later if we stop adding Zuul + # NOTE(mnaser): requests should be installed in this virtualenv + # but this might fail later if we stop adding requests # in the unit tests. test_constraints = os.path.join(os.path.dirname(__file__), 'test-constraints.txt') @@ -59,5 +59,5 @@ class TestToxInstallSiblingPackages(testtools.TestCase): self.assertTrue(os.path.exists(constraints)) with open(constraints) as f: s = f.read() - self.assertNotIn("zuul", s) + self.assertNotIn("requests", s) self.assertIn("doesnotexistonpypi", s) diff --git a/test-requirements.txt b/test-requirements.txt index 68731ca5c..c6858e5bd 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,8 +2,8 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. flake8 -GitPython>=2.1.8,<2.1.12 -zuul +enum34==1.1.6; python_version < "3.4" +zuul; python_version > "3" # We need to pin the ansible version directly here; per the # deprecation policy it should trail the version used by Zuul by 4 diff --git a/tools/update-test-platforms.py b/tools/update-test-platforms.py index 062550471..db0606372 100755 --- a/tools/update-test-platforms.py +++ b/tools/update-test-platforms.py @@ -32,7 +32,7 @@ PLATFORMS = [ 'centos-7', 'centos-8', 'debian-stretch', - 'fedora-29', + 'fedora-30', 'gentoo-17-0-systemd', 'opensuse-15', 'opensuse-tumbleweed', diff --git a/zuul-tests.d/container-roles-jobs.yaml b/zuul-tests.d/container-roles-jobs.yaml index c0c92a94a..66c4d7ee4 100644 --- a/zuul-tests.d/container-roles-jobs.yaml +++ b/zuul-tests.d/container-roles-jobs.yaml @@ -37,13 +37,13 @@ label: debian-stretch - job: - name: zuul-jobs-test-install-docker-fedora-29 - description: Tests install-docker role on fedora-29 + name: zuul-jobs-test-install-docker-fedora-30 + description: Tests install-docker role on fedora-30 parent: zuul-jobs-test-install-docker nodeset: nodes: - - name: fedora-29 - label: fedora-29 + - name: fedora-30 + label: fedora-30 - job: 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-8-nv - 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-xenial - zuul-jobs-test-registry-docker @@ -297,7 +297,7 @@ jobs: - zuul-jobs-test-install-docker-centos-7 - 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-xenial - zuul-jobs-test-registry-docker diff --git a/zuul-tests.d/general-roles-jobs.yaml b/zuul-tests.d/general-roles-jobs.yaml index f6bf14eb0..7bd7f1ade 100644 --- a/zuul-tests.d/general-roles-jobs.yaml +++ b/zuul-tests.d/general-roles-jobs.yaml @@ -155,14 +155,14 @@ label: debian-stretch - job: - name: zuul-jobs-test-base-roles-fedora-29 - description: Tests roles in the 'base' job on fedora-29 + name: zuul-jobs-test-base-roles-fedora-30 + description: Tests roles in the 'base' job on fedora-30 parent: zuul-jobs-test-base-roles tags: auto-generated nodeset: nodes: - - name: fedora-29 - label: fedora-29 + - name: fedora-30 + label: fedora-30 - job: name: zuul-jobs-test-base-roles-gentoo-17-0-systemd @@ -339,16 +339,16 @@ - secondary - job: - name: zuul-jobs-test-multinode-roles-fedora-29 - description: Tests multinode setup roles on fedora-29 + name: zuul-jobs-test-multinode-roles-fedora-30 + description: Tests multinode setup roles on fedora-30 parent: zuul-jobs-test-multinode-roles tags: auto-generated nodeset: nodes: - name: primary - label: fedora-29 + label: fedora-30 - name: secondary - label: fedora-29 + label: fedora-30 groups: - name: switch nodes: @@ -483,7 +483,7 @@ - zuul-jobs-test-base-roles-centos-7 - zuul-jobs-test-base-roles-centos-8 - 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-opensuse-15 - 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-8 - 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-opensuse-15 - 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-8 - 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-opensuse-15 - zuul-jobs-test-base-roles-ubuntu-bionic @@ -526,7 +526,7 @@ - zuul-jobs-test-multinode-roles-centos-7 - zuul-jobs-test-multinode-roles-centos-8 - 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-opensuse-15 - zuul-jobs-test-multinode-roles-ubuntu-bionic