mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-19 01:40:13 +00:00
test: Emit ginkgo log for each node e2e
When running multiple node e2e with multiple machine images, the tests are run separately for each node. The final build log has all of the results for each of the hosts combined together which make debugging the log difficult. To make it easier, emit a log for each host that was run. This log will be written to the results directory and uploaded as an artifact in prow jobs. Signed-off-by: David Porter <david@porter.me>
This commit is contained in:
parent
0980f026c9
commit
e9ecdf3534
@ -196,12 +196,15 @@ func (n *NodeE2ERemote) RunTest(host, workspace, results, imageDesc, junitFilePr
|
||||
systemSpecFile = systemSpecName + ".yaml"
|
||||
}
|
||||
|
||||
outputGinkgoFile := filepath.Join(results, fmt.Sprintf("%s-ginkgo.log", host))
|
||||
|
||||
// Run the tests
|
||||
klog.V(2).Infof("Starting tests on %q", host)
|
||||
cmd := getSSHCommand(" && ",
|
||||
fmt.Sprintf("cd %s", workspace),
|
||||
fmt.Sprintf("timeout -k 30s %fs ./ginkgo %s ./e2e_node.test -- --system-spec-name=%s --system-spec-file=%s --extra-envs=%s --runtime-config=%s --v 4 --node-name=%s --report-dir=%s --report-prefix=%s --image-description=\"%s\" %s",
|
||||
timeout.Seconds(), ginkgoArgs, systemSpecName, systemSpecFile, extraEnvs, runtimeConfig, host, results, junitFilePrefix, imageDesc, testArgs),
|
||||
// Note, we need to have set -o pipefail here to ensure we return the appriorate exit code from ginkgo; not tee
|
||||
fmt.Sprintf("set -o pipefail; timeout -k 30s %fs ./ginkgo %s ./e2e_node.test -- --system-spec-name=%s --system-spec-file=%s --extra-envs=%s --runtime-config=%s --v 4 --node-name=%s --report-dir=%s --report-prefix=%s --image-description=\"%s\" %s 2>&1 | tee -i %s",
|
||||
timeout.Seconds(), ginkgoArgs, systemSpecName, systemSpecFile, extraEnvs, runtimeConfig, host, results, junitFilePrefix, imageDesc, testArgs, outputGinkgoFile),
|
||||
)
|
||||
return SSH(host, "sh", "-c", cmd)
|
||||
return SSH(host, "/bin/bash", "-c", cmd)
|
||||
}
|
||||
|
@ -289,9 +289,9 @@ func main() {
|
||||
fmt.Printf("%s\n", tr.output)
|
||||
if tr.err != nil {
|
||||
errCount++
|
||||
fmt.Printf("Failure Finished Test Suite on Host %s\n%v\n", host, tr.err)
|
||||
fmt.Printf("Failure Finished Test Suite on Host %s. Refer to artifacts directory for ginkgo log for this host.\n%v\n", host, tr.err)
|
||||
} else {
|
||||
fmt.Printf("Success Finished Test Suite on Host %s\n", host)
|
||||
fmt.Printf("Success Finished Test Suite on Host %s. Refer to artifacts directory for ginkgo log for this host.\n", host)
|
||||
}
|
||||
exitOk = exitOk && tr.exitOk
|
||||
fmt.Printf("%s<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<%s\n", blue, noColour)
|
||||
|
Loading…
Reference in New Issue
Block a user