KYUA-REPORT-JUNIT(1)
π kyua report-junit π
okay bestie, gather round, because this one is actually so useful and I need you to know about it. This is the kyua report-junit page from the General Commands Manual, and it's giving "make my CI pretty" energy. π
β¨ NAME β¨
kyua report-junit β generates a JUnit report with the results of a test suite run. periodt. π
πΈ SYNOPSIS πΈ
kyua report-junit [--output path] [--results-file file]
π¦ DESCRIPTION π¦
So like, kyua report-junit is your little bestie that gives you a simple mechanism to generate JUnit reports of a test suite's execution. It takes a results file, does its thing, and then generates a single XML file that complies with the JUnit XSchema. slay. β¨
And here's the iconic part: the JUnit output is static and self-contained, so you can literally just plug it into any continuous integration system, like Jenkins. no cap. π₯
The following subcommand options are recognized:
--outputdirectory β specifies the file into which to store the JUnit report. (yes, the placeholder says directory and the description says file, I'm just telling you exactly what the manpage says, don't come for me π)--results-filepath,-spath β specifies the results file to operate on. It defaults toLATEST, which makeskyua report-junitautomatically load the latest results file from the current test suite.
The following values are accepted:
LATESTβ requests the load of the latest results file available for the test suite rooted at the current directory.- Directory β requests the load of the latest results file available for the test suite rooted at the given directory.
- Test suite name β requests the load of the latest results file available for the given test suite.
- Results identifier β requests the load of a specific results file.
- Explicit file name (aka everything else) β load the specified results file.
See "Results files" for more details. iykyk π
π Caveats π
ngl, there's a catch. Because of limitations in the JUnit XML schema, not all the data collected by Kyua can be properly represented in JUnit reports. But since test data are extremely useful for debugging purposes, kyua report-junit just shovels these data into the JUnit output. In particular:
- The test case metadata values are prepended to the test case's standard error output.
- Test cases that report expected failures as their results are recorded as passed. The fact that they failed as expected is recorded in the test case's standard error output along with the corresponding reason.
lowkey important: expected failures show up as passes in JUnit. the "yes this was supposed to fail" receipts live in stderr. π
π§ Results files π§
Results files contain, as their name implies, the results of the execution of a test suite. Every test suite executed by kyua-test(1) generates a new results file, and those results files can be loaded later on by inspection commands such as kyua-report(1) so you can analyze their contents. π
Results files support identifier-based lookups and also path name lookups. The differences between the two are described below.
The default naming scheme for the results files provides simple support for identifier-based lookups and historical recording of test suite runs. Each results file is given an identifier derived from the test suite that generated it and the time the test suite was run. Kyua can later look up results files by these fields.
The identifier follows this pattern:
<test_suite>.<YYYYMMDD>-<HHMMSS>-<uuuuuu>
where test_suite is the path to the root of the test suite that was run with all slashes replaced by underscores, and YYYYMMDD-HHMMSS-uuuuuu is a timestamp with microsecond resolution. β°
When using the default naming scheme, results files are stored in the ~/.kyua/store/ subdirectory and each file holds a name of the form:
~/.kyua/store/results.<identifier>.db
Results files are simple SQLite databases with the schema described in the /usr/share/kyua/store/schema_v?.sql files. For details on the schema, please refer to the heavily commented SQL file. it's literally commented for you bestie, go read it π
β EXIT STATUS β
The kyua report-junit command always returns 0. iconic behavior honestly.
Additional exit codes may be returned as described in kyua(1).
π EXAMPLES π
π Workflow with results files π
If one runs the following command twice in a row:
kyua test -k /usr/tests/Kyuafile
the two executions will generate two different files with names like:
~/.kyua/store/results.usr_tests.20140731-150500-196784.db
~/.kyua/store/results.usr_tests.20140731-151730-997451.db
Taking advantage of the default naming scheme, the following commands would all generate a report for the results of the latest execution of the test suite:
cd /usr/tests && kyua report-junit
cd /usr/tests && kyua report-junit --results-file=LATEST
kyua report-junit --results-file=/usr/tests
kyua report-junit --results-file=usr_tests
kyua report-junit --results-file=usr_tests.20140731-151730-997451
But it is also possible to explicitly load data for older runs or from explicitly-named files:
kyua report-junit \
--results-file=usr_tests.20140731-150500-196784
kyua report-junit \
--results-file=~/.kyua/store/results.usr_tests.20140731-150500-196784.db
like?? five different ways to get the same report and also a way to time travel back to an older run. main character energy fr fr π
π«Ά SEE ALSO π«Ά
kyua(1), kyua-report(1), kyua-report-html(1)
and that's the whole vibe check π
this page is from Debian, dated October 13, 2014, and it's the KYUA-REPORT-JUNIT(1) page from the General Commands Manual. go forth and make your CI cute. mwah πβ¨π
π¦ where this page comes from
- alpine 3.23: kyua-doc 0.14.1-r0 Β· BSD-3-Clause
- alpine 3.24: kyua-doc 0.14.1-r0 Β· BSD-3-Clause
- debian bookworm: kyua 0.13+git20190402+a685f911237e-1+b1 Β· BSD-3-Clause
- debian trixie: kyua 0.13+git20240311+0a43bb8d89e3-3 Β· BSD-3-Clause
- ubuntu jammy: kyua 0.13+git20190402+a685f911237e-1 Β· BSD-3-Clause
- ubuntu noble: kyua 0.13+git20190402+a685f911237e-1build2 Β· BSD-3-Clause
- ubuntu questing: kyua 0.13+git20240311+0a43bb8d89e3-3
- ubuntu resolute: kyua 0.13+git20240311+0a43bb8d89e3-3build1 Β· BSD-3-Clause
- ubuntu stonking: kyua 0.13+git20240311+0a43bb8d89e3-3build1 Β· BSD-3-Clause
- Copyright 2014 The Kyua Authors
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms