Test both original and latest dnf versions (#85342)

Co-authored-by: Matt Clay <matt@mystile.com>
pull/85346/head^2
Martin Krizek 6 months ago committed by GitHub
parent dde10a9afb
commit ef9d92b31d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -167,6 +167,14 @@ stages:
- 3
- 4
- 5
- template: templates/matrix.yml # context/target (dnf-oldest, dnf-latest)
parameters:
testFormat: linux/{0}
targets:
- name: Fedora 41
test: fedora41
groups:
- 7
- stage: Galaxy
dependsOn: []
jobs:

@ -0,0 +1,4 @@
context/target
destructive
shippable/posix/group7
needs/target/dnf

@ -0,0 +1,16 @@
- when: ansible_distribution == "Fedora"
block:
- command: "dnf install -y 'dnf-command(copr)'"
- name: Test against dnf5 nightly build to detect any issues early
command: dnf copr enable -y rpmsoftwaremanagement/dnf-nightly
- name: Run DNF tests
include_role:
name: dnf
vars:
# Since dnf-latest is the only dnf target that installs the latest version
# test the 'auto_install_module_deps' feature here.
test_auto_install: true
always:
- command: dnf copr disable -y rpmsoftwaremanagement/dnf-nightly

@ -0,0 +1,4 @@
context/target
destructive
shippable/posix/group7
needs/target/dnf

@ -0,0 +1,13 @@
- when: ansible_distribution == "Fedora"
block:
- name: Ensure libdnf is not installed
command: dnf remove -y python3-libdnf5
- name: Downgrade dnf to the original version
command: dnf install -y --disable-repo=* --enable-repo=fedora python3-libdnf5
- name: Run DNF tests
include_role:
name: dnf
vars:
test_auto_install: false

@ -16,6 +16,13 @@
- "not dnf_result.failed | default(False)"
- "rpm_result.rc == 1"
# NOTE Now that the dnf module executed, libdnf is installed even for the case
# when testing 'auto_install_module_deps: false' for dnf5
# and we can print libdnf version we test against for debugging purposes.
- name: libdnf version being tested
debug:
msg: "{{ lookup('pipe', 'rpm -q ' ~ ('python3-libdnf5' if dnf5 else 'python3-libdnf')) }}"
# UNINSTALL AGAIN
- name: uninstall sos
dnf:

@ -1,15 +1,14 @@
# (c) 2014, James Tanner <tanner.jc@gmail.com>
# Copyright: Contributors to the Ansible project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
- set_fact:
dnf5: "{{ (ansible_distribution == 'RedHat' and ansible_distribution_major_version | int > 10) or ansible_distribution == 'Fedora' }}"
- when: dnf5
- when:
- dnf5
- test_auto_install | default(false) # NOTE ensure one of dnf, dnf-oldest or dnf-latest sets test_auto_install
block:
- command: "dnf install -y 'dnf-command(copr)'"
- name: Test against dnf5 nightly build to detect any issues early
command: dnf copr enable -y rpmsoftwaremanagement/dnf-nightly
- name: Ensure module deps are not installed
command: dnf remove -y python3-libdnf5

@ -651,7 +651,8 @@
- assert:
that:
- r is failed
- r.msg is contains("Couldn't open file")
# account for two different messages depending on the libdnf version
- r.msg is contains("Couldn't open file") or r.msg is contains("Failed to download metadata")
always:
- file:
name: /etc/yum.repos.d/{{ repo_name }}.repo

@ -181,6 +181,8 @@ class IntegrationAliasesTest(SanitySingleVersion):
group_numbers = self.ci_test_groups.get(name, None)
if group_numbers:
group_numbers = [num for num in group_numbers if num not in (6, 7)] # HACK: ignore special groups 6 and 7
if min(group_numbers) != 1:
display.warning('Min test group "%s" in %s is %d instead of 1.' % (name, self.CI_YML, min(group_numbers)), unique=True)
@ -291,6 +293,9 @@ class IntegrationAliasesTest(SanitySingleVersion):
if target.name == 'ansible-test-container':
continue # special test target which uses group 6 -- nothing else should be in that group
if target.name in ('dnf-oldest', 'dnf-latest'):
continue # special test targets which use group 7 -- nothing else should be in that group
if f'{self.TEST_ALIAS_PREFIX}/posix/' not in target.aliases:
continue
@ -351,6 +356,12 @@ class IntegrationAliasesTest(SanitySingleVersion):
if path == 'test/integration/targets/ansible-test-container':
continue # special test target which uses group 6 -- nothing else should be in that group
if path in (
'test/integration/targets/dnf-oldest',
'test/integration/targets/dnf-latest',
):
continue # special test targets which use group 7 -- nothing else should be in that group
messages.append(SanityMessage(unassigned_message, '%s/aliases' % path))
for path in conflicting_paths:

Loading…
Cancel
Save