#382 fedora-ci.koji-build.installability.functional test should skip upgrade and downrgade subtests if old packages cannot be installed
Opened by ppisar. Modified

I have a suggestion for skipping upgrade and downgrade subtests if an old build cannot be installed.

A real life example: perl-Alien-PCRE2-0.016000-4.fc38 fixed a bug which prevented from installing perl-Alien-PCRE2-0.016000-3.fc38 https://bodhi.fedoraproject.org/updates/FEDORA-2023-527208f9e1. But fedora-ci.koji-build.installability.functional test for perl-Alien-PCRE2-0.016000-4.fc38 failed https://artifacts.dev.testing-farm.io/6d3f113b-082f-4d51-8dad-ca36c662a54d/:

 ----------------------------------------------------------
|                                                          |
| TEST                                                     |
| ====                                                     |
|                                                          |
|   TYPE:        update                                    |
|   NEVRA:       perl-Alien-PCRE2-0:0.016000-4.fc38.x86_64 |
|   SELINUX:     Enforcing                                 |
|   YUM HISTORY: 8                                         |
|                                                          |
----------------------------------------------------------
 -------------------------------------------------------------------
|                                                                   |
|   Prepare for updating perl-Alien-PCRE2-0:0.016000-4.fc38.x86_64  |
|                                                                   |
-------------------------------------------------------------------
Found available older package: perl-Alien-PCRE2-0:0.016000-3.fc37.x86_64
The oldest installed nevra: perl-Alien-PCRE2-0:0.016000-4.fc38.x86_64
Last metadata expiration check: 0:02:11 ago on Mon 16 Jan 2023 05:23:42 PM UTC.
Error: 
 Problem: conflicting requests
  - nothing provides pkgconfig(libpcre2-8) = 10.40 needed by perl-Alien-PCRE2-0.016000-3.fc37.x86_64
(try to add '--skip-broken' to skip uninstallable packages)

This kind of failure is expected if the previous build cannot be installed. The same applies to a downgrade test:

 ----------------------------------------------------------
|                                                          |
| TEST                                                     |
| ====                                                     |
|                                                          |
|   TYPE:        downgrade                                 |
|   NEVRA:       perl-Alien-PCRE2-0:0.016000-4.fc38.x86_64 |
|   SELINUX:     Enforcing                                 |
|   YUM HISTORY: 8                                         |
|                                                          |
----------------------------------------------------------
 ----------------------------------------------------------------------
|                                                                      |
|   Prepare for downgrading perl-Alien-PCRE2-0:0.016000-4.fc38.x86_64  |
|                                                                      |
----------------------------------------------------------------------
Older package than perl-Alien-PCRE2-0:0.016000-4.fc38.x86_64 is: perl-Alien-PCRE2-0:0.016000-3.fc37.x86_64
The newest installed nevra: perl-Alien-PCRE2-0:0.016000-4.fc38.x86_64
Do not update a new package: perl-Alien-PCRE2-0:0.016000-4.fc38.x86_64.
pkg_install_new_if_absent: package perl-Alien-PCRE2 is present. Do nothing.
pkg_can_be_removed: perl-Alien-PCRE2 can be removed.
Do not remove newer package: perl-Alien-PCRE2-0:0.016000-4.fc38.x86_64
 ---------------------------------------------------------------------
|                                                                     |
|   Run downgrade test for perl-Alien-PCRE2-0:0.016000-4.fc38.x86_64  |
|                                                                     |
---------------------------------------------------------------------
Last metadata expiration check: 0:03:13 ago on Mon 16 Jan 2023 05:23:42 PM UTC.
Error: 
 Problem: conflicting requests
  - nothing provides pkgconfig(libpcre2-8) = 10.40 needed by perl-Alien-PCRE2-0.016000-3.fc37.x86_64
(try to add '--skip-broken' to skip uninstallable packages)

I suggest skipping these two subtest if the old build cannot be installed. You can implement it like this: First install the old build. If it fails, skip update and downgrade subtests. If it passes, proceed with these two subtest.

Skipping inapplicable subtests will relieve package maintainers from reviewing and waiving failures of subtests which cannot succeed because their assumption (old build is installable) is not fulfilled.


I guess this is a reasonable request. Although the fact that previous build cannot be installed is something that simply should not happen (in ideal world).

I've applied Petr's suggestion in mini-tps#37 and changed the update test so that instead of downgrading the package, it:
- removes the package if it's installed
- installs the old build
If that fails, the test is skipped.

So far I've been hesitant about doing the same in the downgrade test case because that'd be 3 operations (remove, install old, update) more than what we do now (for every package) just for this IMHO rare use-case.

I think update and downgrade go hand-in-hand. E.g. perl-Alien-autoconf-0.19-6.fc41 https://artifacts.dev.testing-farm.io/ff653344-78d1-4223-a7b4-6ece29c24396/ fixes a broken RPM dependency. As a result update is skipped and downgrade is failed. Could a skipped update imply skipping the downgrade?

I don't think this is rare. This happens anytime somebody breaks the dependencies in a previous build. And people will break dependencies, until this test or rpmdeplint test becomes mandatory for gating.

Metadata