Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
feat: convert JUnit results into needs.json that every reader importsspl_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 asunit_test_results.needs.json, plus a page that imports them and carries the test specifications'resultslinks asneedextendblocks — the rulesple_tr_linkapplied at build time. CLI and 11 unit tests.feat(docs): let each Sphinx run take options of its ownSPL_SPHINX_OPTIONS(variant runs) andSPL_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: whenSPL_SPHINX_BINARY_DIRdoes 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 runSPL_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 thetest-reportdirective; the component and variant report builds wait for it.Why: the
test-reportdirective 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 thegeneratedlink.Checked
tests/cmake/common.cmake(run directly with cmake on Linux; the harness intest_cmake.pybuilds a Windows path) passes, including new cases for the per-run options and the mounted path; unit tests: 267 passed.reportswith it, and its documentation gate passes for every variant and component report (docs: make Sphinx and ubc agree SPLed#4).