Skip to content

feat: test results as needs.json for every reader - #5

Draft
ubmarco wants to merge 3 commits into
feat/configurable-docs-pipelinefrom
feat/docs-parity-sweep
Draft

ubmarco wants to merge 3 commits into
feat/configurable-docs-pipelinefrom
feat/docs-parity-sweep

Conversation

@ubmarco

@ubmarco ubmarco commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Stacked on #4. The spl-core half of the sweep that makes Sphinx and ubc read the same documents and needs (SPLed side: useblocks/SPLed#4).

In this PR

Commit Change
feat: convert JUnit results into needs.json that every reader imports spl_core.test_report.junit_to_needs: the testfile, testsuite and testcase needs sphinx-test-reports' directive creates, with the same IDs, fields and content (sphinx-test-reports' own parser), written as unit_test_results.needs.json, plus a page that imports them and carries the test specifications' results links as needextend blocks — the rule sple_tr_link applied at build time. CLI and 11 unit tests.
feat(docs): let each Sphinx run take options of its own SPL_SPHINX_OPTIONS (variant runs) and SPL_SPHINX_COMPONENT_OPTIONS (per-component runs), with @SHAPE@ and @COMPONENT_PATH@ filled in per run, so every run can name a file of its own. The binary directory check only compares a path that exists: when SPL_SPHINX_BINARY_DIR does not exist on disk, the project reaches the build another way, for example through a sphinx-mounts mount.
feat: write the test results as needs after each test run SPL_TEST_RESULTS_AS_NEEDS (off by default): the results page is written after each test run by the converter, instead of at configure time with the test-report directive; the component and variant report builds wait for it.

Why: the test-report directive exists only in Sphinx, so ubCode and ubc lacked every test result; both import needs.json. And a per-run selection file lets two builds' reports run side by side without the generated link.

Checked

  • The CMake unit test tests/cmake/common.cmake (run directly with cmake on Linux; the harness in test_cmake.py builds a Windows path) passes, including new cases for the per-run options and the mounted path; unit tests: 267 passed.
  • SPLed builds its Disco test kit and reports with it, and its documentation gate passes for every variant and component report (docs: make Sphinx and ubc agree SPLed#4).

sphinx-test-reports' test-report directive creates the testfile, testsuite
and testcase needs only while Sphinx runs, so ubCode and ubc, which import
needs.json, never see them. Convert the same JUnit XML into the same ids,
types and fields, reusing sphinx-test-reports' own parser, and carry the
results links as data: one needextend per test specification instead of the
Sphinx-only sple_tr_link needs function.

CMake wiring behind an off-by-default setting follows.
SPL_SPHINX_OPTIONS adds options to the variant docs and reports builds and SPL_SPHINX_COMPONENT_OPTIONS to the per-component ones; @shape@ and @COMPONENT_PATH@ in them are filled in per run, so every run can name a file of its own, such as the selection file that names its build directory. The binary directory check only compares a path that exists: when SPL_SPHINX_BINARY_DIR does not exist on disk, the project reaches the binary directory another way, for example through a sphinx-mounts mount, and there is no link to go stale.
With SPL_TEST_RESULTS_AS_NEEDS, a component's unit_test_results page is no longer written at configure time with sphinx-test-reports' test-report directive. After each test run, spl_core.test_report.junit_to_needs converts the JUnit XML into unit_test_results.needs.json and writes the page that imports it, with the results links of the test specifications as needextend blocks. The component and variant report builds wait for it. Off by default.
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.

1 participant