Skip to content
Open
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
19 changes: 16 additions & 3 deletions test/lib.bash
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,15 @@ function go_test_e2e {
[[ -n "$arg" ]] && go_test_args+=("$arg")
done
set +Eeuo pipefail
report_go_test -race -count=1 "${go_test_args[@]}"
retcode=$?
retcode=0
report_go_test -race -count=1 "${go_test_args[@]}" || retcode=$?
set -Eeuo pipefail

print_test_result "$retcode"

if [[ "${MAP_TESTS}" == "true" ]]; then
map_lp_interop_reports
fi

return "$retcode"
}

Expand All @@ -66,6 +70,15 @@ function print_test_result {
fi
}

# Map junit XMLs for the common Layered Product Interop reporting tool
# (renames all Serverless testsuites to "Serverless-lp-interop")
function map_lp_interop_reports {
find "${ARTIFACTS}" -type f -iname "junit_*.xml" | while IFS= read -r result_file; do
cp "$result_file" "$result_file.premap"
sed -i -E 's|(<testsuite .*name=")([^"]*)(")|\1Serverless-lp-interop\3|' "$result_file"
done
}

function serverless_operator_e2e_tests {
should_run "${FUNCNAME[0]}" || return 0

Expand Down
Loading