diff --git a/CHANGELOG.md b/CHANGELOG.md index af051a495e..1df28499ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ ## Changes since v7.0.1 +- [#1039](https://github.com/oauth2-proxy/oauth2-proxy/pull/1039) Ensure errors in tests are logged to the GinkgoWriter (@JoelSpeed) + # V7.0.1 ## Release Highlights diff --git a/main_suite_test.go b/main_suite_test.go index faa0383a99..1fafda3eae 100644 --- a/main_suite_test.go +++ b/main_suite_test.go @@ -10,6 +10,7 @@ import ( func TestMainSuite(t *testing.T) { logger.SetOutput(GinkgoWriter) + logger.SetErrOutput(GinkgoWriter) RegisterFailHandler(Fail) RunSpecs(t, "Main Suite") diff --git a/pkg/apis/middleware/middleware_suite_test.go b/pkg/apis/middleware/middleware_suite_test.go index f2f48cfd84..81833e999c 100644 --- a/pkg/apis/middleware/middleware_suite_test.go +++ b/pkg/apis/middleware/middleware_suite_test.go @@ -13,6 +13,7 @@ import ( // this functionality func TestMiddlewareSuite(t *testing.T) { logger.SetOutput(GinkgoWriter) + logger.SetErrOutput(GinkgoWriter) RegisterFailHandler(Fail) RunSpecs(t, "Middleware API") diff --git a/pkg/apis/options/options_suite_test.go b/pkg/apis/options/options_suite_test.go index 6e1a05f3c0..6f678b0351 100644 --- a/pkg/apis/options/options_suite_test.go +++ b/pkg/apis/options/options_suite_test.go @@ -10,6 +10,7 @@ import ( func TestOptionsSuite(t *testing.T) { logger.SetOutput(GinkgoWriter) + logger.SetErrOutput(GinkgoWriter) RegisterFailHandler(Fail) RunSpecs(t, "Options Suite") diff --git a/pkg/apis/options/util/util_suite_test.go b/pkg/apis/options/util/util_suite_test.go index 75f53dbb20..ecd5bc215c 100644 --- a/pkg/apis/options/util/util_suite_test.go +++ b/pkg/apis/options/util/util_suite_test.go @@ -10,6 +10,7 @@ import ( func TestUtilSuite(t *testing.T) { logger.SetOutput(GinkgoWriter) + logger.SetErrOutput(GinkgoWriter) RegisterFailHandler(Fail) RunSpecs(t, "Options Util Suite") diff --git a/pkg/authentication/basic/basic_suite_test.go b/pkg/authentication/basic/basic_suite_test.go index 6ba23fc322..1cd9d7f7fe 100644 --- a/pkg/authentication/basic/basic_suite_test.go +++ b/pkg/authentication/basic/basic_suite_test.go @@ -10,6 +10,7 @@ import ( func TestBasicSuite(t *testing.T) { logger.SetOutput(GinkgoWriter) + logger.SetErrOutput(GinkgoWriter) RegisterFailHandler(Fail) RunSpecs(t, "Basic") diff --git a/pkg/header/header_suite_test.go b/pkg/header/header_suite_test.go index 3d05cd02dc..00f1a0283e 100644 --- a/pkg/header/header_suite_test.go +++ b/pkg/header/header_suite_test.go @@ -17,6 +17,7 @@ var ( func TestHeaderSuite(t *testing.T) { logger.SetOutput(GinkgoWriter) + logger.SetErrOutput(GinkgoWriter) RegisterFailHandler(Fail) RunSpecs(t, "Header") diff --git a/pkg/middleware/middleware_suite_test.go b/pkg/middleware/middleware_suite_test.go index 1a0d2f141d..494c60900d 100644 --- a/pkg/middleware/middleware_suite_test.go +++ b/pkg/middleware/middleware_suite_test.go @@ -11,6 +11,7 @@ import ( func TestMiddlewareSuite(t *testing.T) { logger.SetOutput(GinkgoWriter) + logger.SetErrOutput(GinkgoWriter) RegisterFailHandler(Fail) RunSpecs(t, "Middleware") diff --git a/pkg/requests/requests_suite_test.go b/pkg/requests/requests_suite_test.go index 54383ffac6..9c22e4d038 100644 --- a/pkg/requests/requests_suite_test.go +++ b/pkg/requests/requests_suite_test.go @@ -21,6 +21,7 @@ var ( func TestRequetsSuite(t *testing.T) { logger.SetOutput(GinkgoWriter) + logger.SetErrOutput(GinkgoWriter) log.SetOutput(GinkgoWriter) RegisterFailHandler(Fail) diff --git a/pkg/requests/util/util_suite_test.go b/pkg/requests/util/util_suite_test.go index a03f943fc8..7be5068652 100644 --- a/pkg/requests/util/util_suite_test.go +++ b/pkg/requests/util/util_suite_test.go @@ -13,6 +13,7 @@ import ( // this functionality func TestRequestUtilSuite(t *testing.T) { logger.SetOutput(GinkgoWriter) + logger.SetErrOutput(GinkgoWriter) RegisterFailHandler(Fail) RunSpecs(t, "Request Utils") diff --git a/pkg/sessions/cookie/session_store_test.go b/pkg/sessions/cookie/session_store_test.go index bf9dda141e..bb45778080 100644 --- a/pkg/sessions/cookie/session_store_test.go +++ b/pkg/sessions/cookie/session_store_test.go @@ -19,6 +19,8 @@ import ( func TestSessionStore(t *testing.T) { logger.SetOutput(GinkgoWriter) + logger.SetErrOutput(GinkgoWriter) + RegisterFailHandler(Fail) RunSpecs(t, "Cookie SessionStore") } diff --git a/pkg/sessions/persistence/persistence_suite_test.go b/pkg/sessions/persistence/persistence_suite_test.go index 57ccc40c43..bc5b5f85dc 100644 --- a/pkg/sessions/persistence/persistence_suite_test.go +++ b/pkg/sessions/persistence/persistence_suite_test.go @@ -10,6 +10,8 @@ import ( func TestPersistenceSuite(t *testing.T) { logger.SetOutput(GinkgoWriter) + logger.SetErrOutput(GinkgoWriter) + RegisterFailHandler(Fail) RunSpecs(t, "Persistence") } diff --git a/pkg/sessions/redis/redis_store_test.go b/pkg/sessions/redis/redis_store_test.go index 2711f85ceb..e6c5f4ed74 100644 --- a/pkg/sessions/redis/redis_store_test.go +++ b/pkg/sessions/redis/redis_store_test.go @@ -33,6 +33,7 @@ func (l *wrappedRedisLogger) Printf(_ context.Context, format string, v ...inter func TestSessionStore(t *testing.T) { logger.SetOutput(GinkgoWriter) + logger.SetErrOutput(GinkgoWriter) redisLogger := &wrappedRedisLogger{Logger: log.New(os.Stderr, "redis: ", log.LstdFlags|log.Lshortfile)} redisLogger.SetOutput(GinkgoWriter) diff --git a/pkg/sessions/session_store_test.go b/pkg/sessions/session_store_test.go index 63dc56e5a4..3918f34206 100644 --- a/pkg/sessions/session_store_test.go +++ b/pkg/sessions/session_store_test.go @@ -18,6 +18,7 @@ import ( func TestSessionStore(t *testing.T) { logger.SetOutput(GinkgoWriter) + logger.SetErrOutput(GinkgoWriter) RegisterFailHandler(Fail) RunSpecs(t, "SessionStore") diff --git a/pkg/upstream/upstream_suite_test.go b/pkg/upstream/upstream_suite_test.go index 581a4cf2dd..f585049c46 100644 --- a/pkg/upstream/upstream_suite_test.go +++ b/pkg/upstream/upstream_suite_test.go @@ -26,6 +26,7 @@ var ( func TestUpstreamSuite(t *testing.T) { logger.SetOutput(GinkgoWriter) + logger.SetErrOutput(GinkgoWriter) log.SetOutput(GinkgoWriter) RegisterFailHandler(Fail) diff --git a/pkg/validation/validation_suite_test.go b/pkg/validation/validation_suite_test.go index c613360a49..091c1565ef 100644 --- a/pkg/validation/validation_suite_test.go +++ b/pkg/validation/validation_suite_test.go @@ -10,6 +10,7 @@ import ( func TestValidationSuite(t *testing.T) { logger.SetOutput(GinkgoWriter) + logger.SetErrOutput(GinkgoWriter) RegisterFailHandler(Fail) RunSpecs(t, "Validation Suite") diff --git a/providers/providers_suite_test.go b/providers/providers_suite_test.go index 6a7f8b1f87..9194eff401 100644 --- a/providers/providers_suite_test.go +++ b/providers/providers_suite_test.go @@ -10,6 +10,7 @@ import ( func TestProviderSuite(t *testing.T) { logger.SetOutput(GinkgoWriter) + logger.SetErrOutput(GinkgoWriter) RegisterFailHandler(Fail) RunSpecs(t, "Providers")