mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 01:06:27 +00:00
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
This commit is contained in:
commit
b1560f36c3
@ -95,6 +95,7 @@ dockercfg-path
|
|||||||
driver-port
|
driver-port
|
||||||
drop-embedded-fields
|
drop-embedded-fields
|
||||||
dry-run
|
dry-run
|
||||||
|
dump-logs-on-failure
|
||||||
duration-sec
|
duration-sec
|
||||||
e2e-output-dir
|
e2e-output-dir
|
||||||
e2e-verify-service-account
|
e2e-verify-service-account
|
||||||
|
@ -204,7 +204,7 @@ func (f *Framework) AfterEach() {
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
// Print events if the test failed.
|
// Print events if the test failed.
|
||||||
if CurrentGinkgoTestDescription().Failed {
|
if CurrentGinkgoTestDescription().Failed && TestContext.DumpLogsOnFailure {
|
||||||
DumpAllNamespaceInfo(f.Client, f.Namespace.Name)
|
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
|
// It accepts namespace base name, which will be prepended with e2e prefix, kube client
|
||||||
// and labels to be applied to a namespace.
|
// and labels to be applied to a namespace.
|
||||||
CreateTestingNS CreateTestingNSFn
|
CreateTestingNS CreateTestingNSFn
|
||||||
|
// If set to true test will dump data about the namespace in which test was running.
|
||||||
|
DumpLogsOnFailure bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type CloudConfig struct {
|
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.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.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.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.")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user