1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fix copr integration tests (#3237) (#3324)

Fixes: #2084
(cherry picked from commit 7c493eb4e5)

Co-authored-by: Silvie Chlupova <33493796+schlupov@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2021-09-02 06:30:01 +02:00 committed by GitHub
parent de602a9b93
commit 3735ee6df7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 10 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- copr - fix chroot naming issues, ``centos-stream`` changed naming to ``centos-stream-<number>`` (for exmaple ``centos-stream-8``) (https://github.com/ansible-collections/community.general/issues/2084, https://github.com/ansible-collections/community.general/pull/3237).

View file

@ -120,8 +120,7 @@ class CoprModule(object):
@property @property
def short_chroot(self): def short_chroot(self):
"""str: Chroot (distribution-version-architecture) shorten to distribution-version.""" """str: Chroot (distribution-version-architecture) shorten to distribution-version."""
chroot_parts = self.chroot.split("-") return self.chroot.rsplit('-', 1)[0]
return "{0}-{1}".format(chroot_parts[0], chroot_parts[1])
@property @property
def arch(self): def arch(self):
@ -193,18 +192,20 @@ class CoprModule(object):
Returns: Returns:
Information about the repository. Information about the repository.
""" """
distribution, version = self.short_chroot.split("-") distribution, version = self.short_chroot.split('-', 1)
chroot = self.short_chroot chroot = self.short_chroot
while True: while True:
repo_info, status_code = self._get(chroot) repo_info, status_code = self._get(chroot)
if repo_info: if repo_info:
return repo_info return repo_info
if distribution == "rhel": if distribution == "rhel":
chroot = "centos-stream" chroot = "centos-stream-8"
distribution = "centos" distribution = "centos"
elif distribution == "centos": elif distribution == "centos":
if version == "stream": if version == "stream-8":
version = "8" version = "8"
elif version == "stream-9":
version = "9"
chroot = "epel-{0}".format(version) chroot = "epel-{0}".format(version)
distribution = "epel" distribution = "epel"
else: else:

View file

@ -3,4 +3,3 @@ needs/root
skip/macos skip/macos
skip/osx skip/osx
skip/freebsd skip/freebsd
disabled # FIXME

View file

@ -6,7 +6,7 @@
host: copr.fedorainfracloud.org host: copr.fedorainfracloud.org
state: enabled state: enabled
name: '@copr/integration_tests' name: '@copr/integration_tests'
chroot: centos-stream-x86_64 chroot: fedora-rawhide-x86_64
register: result register: result
- name: assert that the copr project was enabled - name: assert that the copr project was enabled
@ -21,7 +21,7 @@
copr: copr:
state: enabled state: enabled
name: '@copr/integration_tests' name: '@copr/integration_tests'
chroot: centos-stream-x86_64 chroot: fedora-rawhide-x86_64
register: result register: result
- name: assert that the copr project was enabled - name: assert that the copr project was enabled
@ -46,7 +46,7 @@
copr: copr:
state: disabled state: disabled
name: '@copr/integration_tests' name: '@copr/integration_tests'
chroot: centos-stream-x86_64 chroot: fedora-rawhide-x86_64
register: result register: result
- name: assert that the copr project was disabled - name: assert that the copr project was disabled
@ -61,4 +61,4 @@
host: copr.fedorainfracloud.org host: copr.fedorainfracloud.org
state: absent state: absent
name: '@copr/integration_tests' name: '@copr/integration_tests'
chroot: centos-stream-x86_64 chroot: fedora-rawhide-x86_64