Fix `viewer.html` not rendered when first log in `results.yaml`
Summary
- Fix
viewer.htmlnot being rendered as an iframe when it is the first log entry in TMTresults.yaml - Add
tmt-html-artifact-firsttest scenario to cover this case
Root cause
When viewer.html is the first log entry in results.yaml, TMT maps it to name="testout.log" in results.xml. Oculus only checked the name attribute for .html extension, so it missed this case and rendered the HTML as plain text via log-viewer instead of as an iframe.
Broken (name="testout.log", href="...viewer.html"):
<log href="...viewer.html" name="testout.log" />Working (name="data/viewer.html", href="...viewer.html"):
<log href="...viewer.html" name="data/viewer.html" />Fix
Also check the href attribute for .html extension in selectInlineTestcaseLogs().
Reproducer
- Broken (before fix): https://artifacts.dev.testing-farm.io/aa30da3c-ba3d-403b-b2d5-6d495e914956/
- Working (viewer.html not first): https://artifacts.dev.testing-farm.io/43b3339e-8e95-4e84-b785-83d37225b1d2/
Screenshot (after fix)
Assisted-by: Claude Code
Edited by Miroslav Vadkerti
