Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logformatter: run on system tests & bindings #7924

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 9 additions & 14 deletions contrib/cirrus/logformatter
Original file line number Diff line number Diff line change
Expand Up @@ -517,25 +517,20 @@ END_SYNOPSIS
}

# eg "test fedora", "special_testing_rootless"
# WARNING: As of 2020-10-05, $CIRRUS_TASK_NAME reflects the same
# descriptive content as our $subtest_name argument (confirm via
# cross-checking runner.sh:logformatter() vs cirrus.yml:&std_name_fmt).
# If this ever becomes untrue, just add _tr("Subtest", $subtest_name).
my $test_name = _env_replace("{CIRRUS_TASK_NAME}");
if (my $rcli = $ENV{RCLI}) {
$test_name .= " [remote]" if $rcli eq 'true';
}
else {
$test_name .= " [no RCLI; cannot determine remote/local]";
}
# (Special-case cleanup: Cirrus\ quotes\ spaces; remove for readability).
$test_name =~ s/\\\s+/ /g;
$s .= _tr("Test name", $test_name);

# Subtest, e.g. system_test
$s .= _tr("Subtest", $subtest_name);

# Link to further Cirrus results, e.g. other runs.
# Build is mostly boring, it's usually TASK that we want to see.
$s .= _tr("Cirrus Build ID", "<small>" . _a("{CIRRUS_BUILD_ID}", "https://cirrus-ci.com/build/{CIRRUS_BUILD_ID}") . "</small>");
$s .= _tr("Cirrus <b>Task</b> ID", _a("{CIRRUS_TASK_ID}", "https://cirrus-ci.com/task/{CIRRUS_TASK_ID}"));

# "none", "rootless"
$s .= _tr("Special mode", _env_replace("{SPECIALMODE}"));
$s .= _tr("Cirrus", sprintf("<small>Build %s</small> / <b>Task %s</b>",
_a("{CIRRUS_BUILD_ID}", "https://cirrus-ci.com/build/{CIRRUS_BUILD_ID}"),
_a("{CIRRUS_TASK_ID}", "https://cirrus-ci.com/task/{CIRRUS_TASK_ID}")));

$s .= "</table>\n";
return $s;
Expand Down
14 changes: 8 additions & 6 deletions contrib/cirrus/runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ altbuild() {
esac
}

integration_outputfilter() {
logformatter() {
# Use similar format as human-friendly task name from .cirrus.yml
# shellcheck disable=SC2154
output_name="$TEST_FLAVOR-$PODBIN_NAME-$DISTRO_NV-$PRIV_NAME-$TEST_ENVIRON"
Expand Down Expand Up @@ -134,10 +134,11 @@ dotest() {
# does not return
fi

output_filter="cat" # no filter
if [[ "$testsuite" == "integration" ]]; then
output_filter=integration_outputfilter
fi
# 'logformatter' script makes test logs readable; only works for some tests
case "$testsuite" in
integration|system) output_filter=logformatter ;;
*) output_filter="cat" ;;
esac

# containers/automation sets this to 0 for it's dbg() function
# but the e2e integration tests are also sensitive to it.
Expand Down Expand Up @@ -210,7 +211,8 @@ case "$TEST_FLAVOR" in
bindings)
# shellcheck disable=SC2155
export PATH=$PATH:$GOSRC/hack
cd pkg/bindings/test && ginkgo -trace -noColor -debug -r
# Subshell needed for .cirrus.yml to find logformatter output in cwd
(cd pkg/bindings/test && ginkgo -trace -noColor -debug -r) |& logformatter
;;
endpoint)
make test-binaries
Expand Down