report: handle stable and legacy Fedora Media Writer sources
Some checks failed
CI via Tox / tox (pull_request) Has been cancelled
CI via Tox / checkwiki (pull_request) Has been cancelled

Fedora Media Writer validation can now test multiple Fedora release
sources, not only the current compose release and Flathub. Derive the
wiki result column from the test name so that stable and legacy variants
report to the previous Fedora releases:

- media_writer_stable reports to Fedora N-1
- media_writer_legacy reports to Fedora N-2
- CANNED jobs continue to report to Flathub

Add coverage for the new Fedora Media Writer source replacement logic in
test_uniqueres_replacements.
This commit is contained in:
Lukáš Růžička 2026-05-20 14:34:19 +02:00
commit ea3f1e0023
3 changed files with 31 additions and 1 deletions

View file

@ -1481,6 +1481,12 @@ TESTSUITES = {
"media_writer": [
"QA:Testcase_USB_fmw",
],
"media_writer_stable": [
"QA:Testcase_USB_fmw",
],
"media_writer_legacy": [
"QA:Testcase_USB_fmw",
],
"desktop_graphics_validation": [
"QA:Testcase_desktop_graphics_validation",
],

View file

@ -73,7 +73,16 @@ def _uniqueres_replacements(job, tcdict):
# 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), so
# if CANNED is set, let's change the string to "Flathub".
fmw_source = f"Fedora {version}"
# At the same time, we also have two more FMW tests named media_writer_stable
# and media_writer_legacy. In these cases, the version number must be lowered
# accordingly to VERSION-1 when stable and VERSION-2 when legacy.
vm_version = int(version)
testname = job["test"]
if testname.endswith("stable"):
vm_version -= 1
elif testname.endswith("legacy"):
vm_version -= 2
fmw_source = f"Fedora {vm_version}"
if job["settings"].get('CANNED', ''):
fmw_source = "Flathub"
if arch == "aarch64":

View file

@ -135,10 +135,25 @@ def test_uniqueres_replacements(jobdict01):
ret = fosreport._uniqueres_replacements(jobdict01, basedict)
assert ret['base_section'] == 'RPM-based non-blocking environments (x86_64)'
# tests for various fmw_source variants
# test media_writer_stable:
with mock.patch.dict(jobdict01, {"test": "media_writer_stable"}):
ret = fosreport._uniqueres_replacements(jobdict01, basedict)
assert ret["fmw_source"] == "Fedora 26"
# test media_writer_legacy:
with mock.patch.dict(jobdict01, {"test": "media_writer_legacy"}):
ret = fosreport._uniqueres_replacements(jobdict01, basedict)
assert ret["fmw_source"] == "Fedora 25"
# 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"
# CANNED still wins when both are true
with mock.patch.dict(jobdict01, {"test": "media_writer_stable"}):
with mock.patch.dict(jobdict01['settings'], {'CANNED': '1'}):
ret = fosreport._uniqueres_replacements(jobdict01, basedict)
assert ret["fmw_source"] == "Flathub"
class TestGetPassedTcNames:
"""Tests for _get_passed_tcnames."""