-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run the
report
step upon failures as well (#3466)
In order to report at least partial test results, let's execute the `report` step also when the test run is interrupted in the middle of the test execution (for example when the guest becomes unresponsive).
- Loading branch information
Showing
6 changed files
with
73 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/plan: | ||
discover: | ||
how: fmf | ||
provision: | ||
how: virtual | ||
execute: | ||
how: tmt | ||
report: | ||
how: html | ||
|
||
/test: | ||
/good: | ||
order: 0 | ||
test: exit 0 | ||
/bad: | ||
order: 1 | ||
test: exit 1 | ||
/weird: | ||
order: 2 | ||
test: rm -f /bin/bash | ||
/missed: | ||
order: 3 | ||
test: /bin/true |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
summary: Make sure that report is performed on error | ||
description: | ||
If the run is interrupted in the middle of the test execution, | ||
the report step should still be performed in order to provide | ||
at least partial test results to the user. | ||
tag+: | ||
- provision-only | ||
- provision-virtual |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
. /usr/share/beakerlib/beakerlib.sh || exit 1 | ||
|
||
rlJournalStart | ||
rlPhaseStartSetup | ||
rlRun "run=\$(mktemp -d)" 0 "Create a run directory" | ||
rlRun "pushd data" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest | ||
rlRun -s "tmt run -vvv --id $run" 2 | ||
|
||
# Tests before the breakage are executed as expected | ||
rlAssertGrep "pass /test/good" $rlRun_LOG | ||
rlAssertGrep "fail /test/bad" $rlRun_LOG | ||
|
||
# Report is generated | ||
rlAssertGrep "^\s*report\s*$" $rlRun_LOG | ||
rlAssertGrep "how: html" $rlRun_LOG | ||
rlAssertGrep "output: /.*/plan/report/default-0/index.html" $rlRun_LOG | ||
rlAssertGrep "summary: 1 test passed and 1 test failed" $rlRun_LOG | ||
rlPhaseEnd | ||
|
||
rlPhaseStartCleanup | ||
rlRun "popd" | ||
rlGetTestState || rlFileSubmit "$run/log.txt" | ||
rlRun "rm -r $run" 0 "Remove the run directory" | ||
rlPhaseEnd | ||
rlJournalEnd |
This file contains 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