Commit b1560f36 authored by k8s-merge-robot's avatar k8s-merge-robot

Merge pull request #25477 from gmarek/e2e_dump

Automatic merge from submit-queue Add a flag to disable dumpig logs after e2e test failure cc @kubernetes/sig-testing
parents 196b1c1f 2696e35b
......@@ -95,6 +95,7 @@ dockercfg-path
driver-port
drop-embedded-fields
dry-run
dump-logs-on-failure
duration-sec
e2e-output-dir
e2e-verify-service-account
......
......@@ -204,7 +204,7 @@ func (f *Framework) AfterEach() {
}()
// Print events if the test failed.
if CurrentGinkgoTestDescription().Failed {
if CurrentGinkgoTestDescription().Failed && TestContext.DumpLogsOnFailure {
DumpAllNamespaceInfo(f.Client, f.Namespace.Name)
}
......
......@@ -58,6 +58,8 @@ type TestContextType struct {
// It accepts namespace base name, which will be prepended with e2e prefix, kube client
// and labels to be applied to a namespace.
CreateTestingNS CreateTestingNSFn
// If set to true test will dump data about the namespace in which test was running.
DumpLogsOnFailure bool
}
type CloudConfig struct {
......@@ -125,4 +127,5 @@ func RegisterFlags() {
flag.BoolVar(&TestContext.GatherLogsSizes, "gather-logs-sizes", false, "If set to true framework will be monitoring logs sizes on all machines running e2e tests.")
flag.BoolVar(&TestContext.GatherMetricsAfterTest, "gather-metrics-at-teardown", false, "If set to true framwork will gather metrics from all components after each test.")
flag.StringVar(&TestContext.OutputPrintType, "output-print-type", "hr", "Comma separated list: 'hr' for human readable summaries 'json' for JSON ones.")
flag.BoolVar(&TestContext.DumpLogsOnFailure, "dump-logs-on-failure", true, "If set to true test will dump data about the namespace in which test was running.")
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment