Modify version string on CANNED environments
All checks were successful
CI via Tox / tox (pull_request) Successful in 2m8s
CI via Tox / checkwiki (pull_request) Successful in 48s

Previously, we have modified on the specific name of the test,
which required an extra test to be run with the correct name.

This PR changes the behaviour to modify on CANNED environments,
so the extra test will not be necessary.
This commit is contained in:
Lukáš Růžička 2026-05-13 10:48:04 +02:00
commit 9b8de87940
2 changed files with 4 additions and 5 deletions

View file

@ -71,10 +71,10 @@ def _uniqueres_replacements(job, tcdict):
if version == "Rawhide":
version = job['settings'].get('RAWREL', '')
# For Fedora Media Writer, version is not enough because we also need to
# to report to the Flathub column (which does not have version in it).
# For Flatpak media_writer test, take "Flathub" instead of version.
# to report to the Flathub column (which does not have version in it), so
# if CANNED is set, let's change the string to "Flathub".
fmw_source = f"Fedora {version}"
if job["test"] == "media_writer_flatpak":
if job["settings"].get('CANNED', ''):
fmw_source = "Flathub"
if arch == "aarch64":
bootmethod = "aarch64"
@ -132,7 +132,6 @@ def _uniqueres_replacements(job, tcdict):
value = value.replace('$VERSION$', version)
value = value.replace('$FMW_SOURCE$', fmw_source)
changed[key] = value
return changed

View file

@ -135,7 +135,7 @@ def test_uniqueres_replacements(jobdict01):
ret = fosreport._uniqueres_replacements(jobdict01, basedict)
assert ret['base_section'] == 'RPM-based non-blocking environments (x86_64)'
# Correct version (fmw_source) string for Non-Canned vs Canned runs
# Correct version (fmw_source) string for CANNED
with mock.patch.dict(jobdict01['settings'], {'CANNED': '1'}):
ret = fosreport._uniqueres_replacements(jobdict01, basedict)
assert ret["fmw_source"] == "Flathub"