tmt
tmt copied to clipboard
Add support for test phases
As discussed on the stakeholder meeting, there are use cases related to tracking individual results of test "phases". These can be created using one of the following ways:
- defining a
beakerlib
phase usingrlPhaseStart
andrlPhaseEnd
- explicitly calling
rstrnt-report-result
to submit a subresult
When run in Beaker
, the rlPhaseEnd
command called during a beakerlib
test execution actually calls rlReport
which uses BEAKERLIB_COMMAND_REPORT_RESULT
command to report the result and, if I'm not mistaken, this defaults to using rstrnt-report-result
. @sopos, please correct me if I'm wrong.
The effect is that each beakerlib
phase and rstrnt-report-result
call create a "subresult" which is shown in the Beaker
web interface under the actual test. The proposal is to add a similar support for subresults to tmt
.
Here are some more ideas caught from the brainstorm:
- We could inject a custom script using
BEAKERLIB_COMMAND_REPORT_RESULT
and perform necessary actions on the guest - The result specification could be extended to include a list of subresults (which would be similar to the
check
attribute) - It would be good to report detected
avc
failures for each test phase separately - Report plugins would have to invent the proper mapping to e.g.
junit
format as the spec does not know subresults
All in all it seems this would bring a substantial level of complexity (currently the test granularity was simply defined by the test metadata definition for each test) so we should discuss this well before jumping into the implementation.
Base Work
- spec — https://github.com/teemtee/tmt/pull/2933
- class — https://github.com/teemtee/tmt/pull/3094
- https://github.com/teemtee/tmt/pull/3106
- actual saving of subresults into
results.yaml
- https://github.com/teemtee/tmt/pull/3200
Report Plugins
- display — https://github.com/teemtee/tmt/pull/3107
- html — https://github.com/teemtee/tmt/pull/3095
- junit
- https://github.com/teemtee/tmt/pull/3150
- https://github.com/teemtee/tmt/pull/3177
- polarion — https://github.com/teemtee/tmt/pull/3166