mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 19:01:49 +00:00
e2e: dump full report information
The Ginkgo CLI output no longer has the full output. We need the reports generated by Ginkgo for that.
This commit is contained in:
parent
460f796bb7
commit
6db4b741dd
@ -163,6 +163,18 @@ if [[ "${GINKGO_NO_COLOR}" == "y" ]]; then
|
||||
ginkgo_args+=("--no-color")
|
||||
fi
|
||||
|
||||
if [[ -n "${E2E_REPORT_DIR:-}" ]]; then
|
||||
report_dir="${E2E_REPORT_DIR}"
|
||||
else
|
||||
# Some jobs don't use E2E_REPORT_DIR and instead pass --report-dir=<dir>
|
||||
# as parameter.
|
||||
for arg in "${@}"; do
|
||||
# shellcheck disable=SC2001
|
||||
# (style): See if you can use ${variable//search/replace} instead.
|
||||
case "$arg" in -report-dir=*|--report-dir=*) report_dir="$(echo "$arg" | sed -e 's/^[^=]*=//')";; esac
|
||||
done
|
||||
fi
|
||||
|
||||
# The --host setting is used only when providing --auth_config
|
||||
# If --kubeconfig is used, the host to use is retrieved from the .kubeconfig
|
||||
# file and the one provided with --host is ignored.
|
||||
@ -183,6 +195,19 @@ case "${E2E_TEST_DEBUG_TOOL:-ginkgo}" in
|
||||
program+=("--nodes=25")
|
||||
fi
|
||||
program+=("${ginkgo_args[@]:+${ginkgo_args[@]}}")
|
||||
|
||||
if [[ -n "${report_dir:-}" ]]; then
|
||||
# The JUnit report written by the E2E suite gets truncated to avoid
|
||||
# overwhelming the tools that need to process it. For manual analysis
|
||||
# it is useful to have the full reports in both formats that Ginkgo
|
||||
# supports:
|
||||
# - JUnit for comparison with the truncated report.
|
||||
# - JSON because it is a faithful representation of
|
||||
# all available information.
|
||||
#
|
||||
# This has to be passed to the CLI, the suite doesn't support --output-dir.
|
||||
program+=("--output-dir=${report_dir}" "--junit-report=ginkgo_report.xml" "--json-report=ginkgo_report.json")
|
||||
fi
|
||||
;;
|
||||
delve) program=("dlv" "exec") ;;
|
||||
gdb) program=("gdb") ;;
|
||||
|
@ -549,8 +549,8 @@ func writeJUnitReport(report ginkgo.Report) {
|
||||
trimmedReport.SpecReports = nil
|
||||
for _, specReport := range report.SpecReports {
|
||||
// Remove details for any spec that hasn't failed. In Prow,
|
||||
// the test output captured in build-log.txt has all of this
|
||||
// information, so we don't need it in the XML.
|
||||
// jobs that use ginkgo-e2e.sh will dump the full
|
||||
// information into ginkgo_report.xml/json.
|
||||
if specReport.State != types.SpecStateFailed {
|
||||
specReport.CapturedGinkgoWriterOutput = ""
|
||||
specReport.CapturedStdOutErr = ""
|
||||
|
Loading…
Reference in New Issue
Block a user