mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 06:54:01 +00:00
Make it possible to re-enable color output in Ginkgo e2e tests
Instead of forcing the NoColor flag to on at runtime, make it default to being on in a way that it's still possible to override it by passing e2e the --ginkgo.noColor=false command-line flag. Tested by running the tests with and without the flag and confirming that both worked as expected.
This commit is contained in:
parent
ca6de16df7
commit
47739abb30
@ -30,6 +30,12 @@ import (
|
||||
|
||||
type testResult bool
|
||||
|
||||
func init() {
|
||||
// Turn off colors by default to make it easier to collect console output in Jenkins
|
||||
// Override colors off with --ginkgo.noColor=false in the command-line
|
||||
config.DefaultReporterConfig.NoColor = true
|
||||
}
|
||||
|
||||
func (t *testResult) Fail() { *t = false }
|
||||
|
||||
// Run each Go end-to-end-test. This function assumes the
|
||||
@ -57,8 +63,6 @@ func RunE2ETests(authConfig, certDir, host, repoRoot, provider string, orderseed
|
||||
|
||||
var passed testResult = true
|
||||
gomega.RegisterFailHandler(ginkgo.Fail)
|
||||
// Turn of colors for now to make it easier to collect console output in Jenkins
|
||||
config.DefaultReporterConfig.NoColor = true
|
||||
var r []ginkgo.Reporter
|
||||
if reportDir != "" {
|
||||
// TODO: When we start using parallel tests we need to change this to "junit_%d.xml",
|
||||
|
Loading…
Reference in New Issue
Block a user