-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Save the subresults for tmt-report-result
All the results generated by tmt-report-results become objects of `tmt.result.SubResult`.
- Loading branch information
Showing
12 changed files
with
192 additions
and
39 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
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
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 @@ | ||
#!/bin/bash | ||
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k | ||
. /usr/share/beakerlib/beakerlib.sh || exit 1 | ||
|
||
|
||
rlJournalStart | ||
rlPhaseStartSetup | ||
rlRun "run_dir=\$(mktemp -d)" 0 "Create run directory" | ||
rlRun "pushd subresults" | ||
rlRun "set -o pipefail" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest "Verbose execute prints result" | ||
# TODO: fix the return code? | ||
rlRun "tmt run --id $run_dir --scratch -v 2>&1 >/dev/null | tee output" 1 | ||
rlPhaseEnd | ||
|
||
rlPhaseStartCleanup | ||
rlRun "rm output" | ||
rlRun "popd" | ||
rlRun "rm -rf $run_dir" 0 "Remove 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1 |
26 changes: 26 additions & 0 deletions
26
tests/execute/result/subresults/beaker-phases-subresults.sh
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,26 @@ | ||
#!/bin/bash | ||
. /usr/share/beakerlib/beakerlib.sh || exit 1 | ||
|
||
|
||
rlJournalStart | ||
rlPhaseStartSetup | ||
rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory" | ||
rlRun "pushd $tmp" | ||
rlRun "set -o pipefail" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest | ||
rlRun "echo mytest-pass | tee output" 0 "Check output" | ||
rlAssertGrep "mytest-pass" "output" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest | ||
rlRun "echo mytest-fail | tee output" 0 "Check output" | ||
rlAssertGrep "asdf-asdf" "output" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartCleanup | ||
rlRun "popd" | ||
rlRun "rm -r $tmp" 0 "Remove tmp 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/plan: | ||
discover: | ||
how: fmf | ||
provision: | ||
#how: local | ||
how: container | ||
execute: | ||
how: tmt |
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,32 @@ | ||
/pass: | ||
summary: Basic test of subresults | ||
test: | | ||
tmt-report-result /subtest/good0 PASS | ||
tmt-report-result /subtest/good1 PASS | ||
tmt-report-result /subtest/good2 PASS | ||
|
||
/fail: | ||
summary: Reduced outcome of subresults must be fail | ||
test: | | ||
tmt-report-result /subtest/good PASS | ||
tmt-report-result /subtest/fail FAIL | ||
tmt-report-result /subtest/weird WARN | ||
|
||
/beakerlib: | ||
summary: Beakerlib rlPhaseEnd as tmt subresult | ||
|
||
# Explicitly set the TESTID to non-empty value. Also, set the | ||
# BEAKERLIB_COMMAND_REPORT_RESULT to `tmt-report-result` explicitly. The | ||
# command in this variable gets called with every `rlPhaseEnd`. | ||
# | ||
# Refs: | ||
# - https://github.com/teemtee/tmt/issues/2826#issue-2225993479 | ||
# - https://github.com/teemtee/tmt/issues/2826#issuecomment-2085014960 | ||
environment: | ||
TESTID: 12345678 | ||
BEAKERLIB_COMMAND_REPORT_RESULT: tmt-report-result | ||
|
||
# Also, explicitly set the framework | ||
framework: beakerlib | ||
|
||
test: ./beaker-phases-subresults.sh |
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
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