Skip to content

Showcase JUnit XML <properties> for requirement traceability via sphinx-test-reports#63

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/add-properties-to-coffee-machine-junit-xml
Draft

Showcase JUnit XML <properties> for requirement traceability via sphinx-test-reports#63
Copilot wants to merge 2 commits into
mainfrom
copilot/add-properties-to-coffee-machine-junit-xml

Conversation

Copilot AI commented May 21, 2026

Copy link
Copy Markdown

Demonstrates the sphinx-test-reports feature that extracts JUnit XML <properties> and maps them to sphinx-needs link fields, creating an automatic traceability chain from SWREQ → test spec → test-run result.

Changes

  • docs/testsuites/coffee_machine_junit.xml — each test case now carries a <properties> block with a verifies property pointing to its SWREQ(s):

    <testcase classname="interfaces::tests::test_brew_strength_enum" name="TEST_BREW_STRENGTH" time="0.001">
      <properties>
        <property name="verifies" value="SWREQ_BREW_STRENGTH" />
      </properties>
    </testcase>
  • docs/conf.py — two new sphinx-test-reports options wired into the existing SPHINX-TEST-REPORTS section:

    tr_extra_options = ["verifies"]
    tr_property_link_types = {"verifies": "links"}

    These remain in conf.py (not ubproject.toml) because they are sphinx-test-reports Python variables with no TOML equivalent.

  • scripts/cargo_test_to_junit.py — adds a SPEC_TO_SWREQ mapping and emits <properties> during XML generation, so the traceability data survives future cargo test regeneration runs.

…-machine example

- Add <properties> with verifies entries to coffee_machine_junit.xml,
  mapping each test case to its SWREQ IDs
- Add tr_extra_options and tr_property_link_types to conf.py so
  sphinx-test-reports extracts the property and creates sphinx-needs links
- Update cargo_test_to_junit.py with SPEC_TO_SWREQ mapping so future
  XML regeneration also emits <properties> elements

Agent-Logs-Url: https://github.com/useblocks/sphinx-needs-demo/sessions/fae64db7-26cd-40e4-9ee9-e7e17e7e1554

Co-authored-by: arnoox <18502091+arnoox@users.noreply.github.com>
Copilot AI changed the title [WIP] Showcase: Use sphinx-test-reports JUnit XML properties for requirement traceability Showcase JUnit XML <properties> for requirement traceability via sphinx-test-reports May 21, 2026
Copilot finished work on behalf of arnoox May 21, 2026 14:54
Copilot AI requested a review from arnoox May 21, 2026 14:54
Comment thread docs/conf.py

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can't we move the config into ubproject.toml?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Well, I was thinking we could demonstrate how to provide test run information from cargo, like: logs, execution time, ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Showcase: Use sphinx-test-reports JUnit XML properties for requirement traceability

2 participants