Skip to content

feat: add web_link field to Result for browsable test links#4878

Open
kamaxeon wants to merge 1 commit into
teemtee:mainfrom
kamaxeon:tft-2683-result-source-url
Open

feat: add web_link field to Result for browsable test links#4878
kamaxeon wants to merge 1 commit into
teemtee:mainfrom
kamaxeon:tft-2683-result-source-url

Conversation

@kamaxeon
Copy link
Copy Markdown

@kamaxeon kamaxeon commented May 8, 2026

Summary

Add a web_link field to the Result dataclass in tmt/result.py that serializes
the browsable test source URL directly into results.yaml as web-link, so downstream
consumers (gluetools, kcidb) get a ready-to-use link instead of having to reconstruct it
from fmf-id.

  • The field name is consistent with the existing Core.web_link() method and tmt test show output
  • Populated via Test.web_link() in from_test_invocation()
  • Returns None for local tests / shell discover (no URL available)
  • Returns a browsable URL for tests from Git repos (GitLab, GitHub, Pagure, etc.)

Example output in results.yaml

- name: /tests/nvidia/driver-install
  result: pass
  fmf-id:
    url: https://gitlab.cee.redhat.com/gpu-accelerators/tests
    ref: main
    name: /tests/nvidia/driver-install
    path: .
  web-link: https://gitlab.cee.redhat.com/gpu-accelerators/tests/-/blob/main/tests/nvidia/driver-install/main.fmf
  duration: 00:05:23
  serial-number: 1

Ref: TFT-2683

Pull Request Checklist

  • implement the feature
  • write the documentation
  • extend the test coverage
  • update the specification
  • adjust plugin docstring
  • modify the json schema
  • mention the version
  • include a release note

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

Add a source_url field to the Result class, populate it using invocation.test.web_link(), and include unit tests for serialization. Strengthen the assertion in test_result_source_url_none_roundtrip by checking for the key's absence in the serialized output to avoid ambiguity.

Comment thread tests/unit/test_results.py Outdated
@happz
Copy link
Copy Markdown
Contributor

happz commented May 8, 2026

  1. should ut be source-url, or taher web-link which is key used emitted by tmt test export? We should have one name for the property.
  2. Update JSON schema in tmt/schemas/results.yaml, please.
  3. Update the specification in spec/results.fmf, please.

@kamaxeon kamaxeon force-pushed the tft-2683-result-source-url branch from b0b7934 to c88f976 Compare May 8, 2026 11:42
Comment thread tmt/schemas/results.yaml Outdated
@kamaxeon kamaxeon force-pushed the tft-2683-result-source-url branch from c88f976 to 1b7af1d Compare May 11, 2026 11:48
@LecrisUT LecrisUT added the ci | full test Pull request is ready for the full test execution label May 11, 2026
@LecrisUT
Copy link
Copy Markdown
Member

LecrisUT commented May 11, 2026

/packit build

@kamaxeon kamaxeon changed the title feat: add source_url field to Result for browsable test links feat: add web_link field to Result for browsable test links May 11, 2026
@kamaxeon kamaxeon force-pushed the tft-2683-result-source-url branch from 1b7af1d to b1ba746 Compare May 12, 2026 08:08
@kamaxeon
Copy link
Copy Markdown
Author

@LecrisUT ,

I just updated the MR request to fix a failing test on Fedora and CentOS.

@kamaxeon
Copy link
Copy Markdown
Author

CI Status

The two remaining failures are not related to this PR:

  1. testing-farm:fedora-44-x86_64:provision-image-mode-virtual — The /plans/provision/virtual/prepare schedule entry errored with Failure during Ansible playbook execution. This is a Testing Farm infrastructure issue during guest setup, not a test failure.

  2. testing-farm:centos-stream-10-x86_64:full — The only failing test is /tests/multihost/complete (subresult: /Require-Test-Skipped-on-Client-2-with-error-return-code) under /plans/features/advanced. This is a pre-existing multihost test unrelated to the web_link changes in this PR (17 tests passed, 1 failed).

All *:full jobs that previously failed due to test_result_web_link_none_roundtrip are now passing.

@thrix thrix added this to planning May 13, 2026
@github-project-automation github-project-automation Bot moved this to backlog in planning May 13, 2026
@thrix thrix moved this from backlog to implement in planning May 13, 2026
* Add `web_link` field to the `Result` dataclass, serialized as
  `web-link` in `results.yaml`
* Populate the field via `Test.web_link()` in `from_test_invocation()`
* Add `web-link` to the results JSON schema (`results.yaml`)
* Add spec example in `spec/results.fmf`
* Fix `test_result_web_link_none_roundtrip` to match serialization
  framework behavior (None values are serialized, not omitted)
* Add `test_result_web_link_missing_in_serialized` for backward
  compatibility with old results lacking `web-link`

Ref: TFT-2683
Signed-off-by: Israel Santana Aleman <isantana@redhat.com>
@happz happz force-pushed the tft-2683-result-source-url branch from b1ba746 to 5aaa518 Compare May 14, 2026 08:26
@happz happz moved this from implement to review in planning May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci | full test Pull request is ready for the full test execution

Projects

Status: review

Development

Successfully merging this pull request may close these issues.

4 participants