-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for custom template with subresults
- Loading branch information
Showing
4 changed files
with
105 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
. /usr/share/beakerlib/beakerlib.sh || exit 1 | ||
|
||
|
||
rlJournalStart | ||
rlPhaseStartSetup "phase-setup" | ||
rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory" | ||
rlRun "pushd $tmp" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest "phase-test pass" | ||
rlRun -s "echo mytest-pass" 0 "Check output" | ||
rlAssertGrep "mytest-pass" "$rlRun_LOG" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest "phase-test fail" | ||
rlRun -s "echo mytest-fail" 0 "Check output" | ||
rlAssertGrep "asdf-asdf" "$rlRun_LOG" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartTest "phase-test multiple tmt-report-result" | ||
# This will create more subresults for each tmt-report-result call | ||
rlRun "tmt-report-result extra-tmt-report-result/good PASS" | ||
rlRun "tmt-report-result extra-tmt-report-result/bad FAIL" | ||
rlRun "tmt-report-result extra-tmt-report-result/weird WARN" | ||
rlRun "tmt-report-result extra-tmt-report-result/skip SKIP" | ||
rlPhaseEnd | ||
|
||
rlPhaseStartCleanup "phase-cleanup" | ||
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,14 @@ | ||
<?xml version="1.0" ?> | ||
|
||
<tests disabled="0" errors="{{ RESULTS.errored | length }}" failures="{{ RESULTS.failed | length }}" tests="{{ RESULTS | length }}" time="{{ RESULTS.duration }}"> | ||
{% for result in RESULTS %} | ||
{% set main_test_duration = result.duration | duration_to_seconds %} | ||
<result name="{{ result.name | trim | e }}" disabled="0" errors="{{ result.subresult.errored | length }}" failures="{{ result.subresult.failed | length }}" skipped="{{ result.subresult.skipped | length }}" tests="{{ result.subresult | length }}" time="{{ main_test_duration }}" outcome="{{ result.result.value }}" timestamp="{{ result.start_time }}"> | ||
{% for subresult in result.subresult %} | ||
{% set subresult_test_duration = subresult.duration | duration_to_seconds %} | ||
<subresult name="{{ subresult.name | e }}" {% if subresult_test_duration %}time="{{ subresult_test_duration }}"{% endif %} outcome="{{ subresult.result.value }}"></subresult> | ||
{% endfor %} | ||
</result> | ||
|
||
{% endfor %} | ||
</tests> |
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