Skip to content

Commit

Permalink
Ensure errors in tests are logged to the GinkgoWriter
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelSpeed committed Feb 10, 2021
1 parent 4fa607f commit b6cca79
Show file tree
Hide file tree
Showing 17 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions main_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

func TestMainSuite(t *testing.T) {
logger.SetOutput(GinkgoWriter)
logger.SetErrOutput(GinkgoWriter)

RegisterFailHandler(Fail)
RunSpecs(t, "Main Suite")
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/middleware/middleware_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
// this functionality
func TestMiddlewareSuite(t *testing.T) {
logger.SetOutput(GinkgoWriter)
logger.SetErrOutput(GinkgoWriter)

RegisterFailHandler(Fail)
RunSpecs(t, "Middleware API")
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/options/options_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

func TestOptionsSuite(t *testing.T) {
logger.SetOutput(GinkgoWriter)
logger.SetErrOutput(GinkgoWriter)

RegisterFailHandler(Fail)
RunSpecs(t, "Options Suite")
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/options/util/util_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

func TestUtilSuite(t *testing.T) {
logger.SetOutput(GinkgoWriter)
logger.SetErrOutput(GinkgoWriter)

RegisterFailHandler(Fail)
RunSpecs(t, "Options Util Suite")
Expand Down
1 change: 1 addition & 0 deletions pkg/authentication/basic/basic_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

func TestBasicSuite(t *testing.T) {
logger.SetOutput(GinkgoWriter)
logger.SetErrOutput(GinkgoWriter)

RegisterFailHandler(Fail)
RunSpecs(t, "Basic")
Expand Down
1 change: 1 addition & 0 deletions pkg/header/header_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ var (

func TestHeaderSuite(t *testing.T) {
logger.SetOutput(GinkgoWriter)
logger.SetErrOutput(GinkgoWriter)

RegisterFailHandler(Fail)
RunSpecs(t, "Header")
Expand Down
1 change: 1 addition & 0 deletions pkg/middleware/middleware_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

func TestMiddlewareSuite(t *testing.T) {
logger.SetOutput(GinkgoWriter)
logger.SetErrOutput(GinkgoWriter)

RegisterFailHandler(Fail)
RunSpecs(t, "Middleware")
Expand Down
1 change: 1 addition & 0 deletions pkg/requests/requests_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ var (

func TestRequetsSuite(t *testing.T) {
logger.SetOutput(GinkgoWriter)
logger.SetErrOutput(GinkgoWriter)
log.SetOutput(GinkgoWriter)

RegisterFailHandler(Fail)
Expand Down
1 change: 1 addition & 0 deletions pkg/requests/util/util_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
// this functionality
func TestRequestUtilSuite(t *testing.T) {
logger.SetOutput(GinkgoWriter)
logger.SetErrOutput(GinkgoWriter)

RegisterFailHandler(Fail)
RunSpecs(t, "Request Utils")
Expand Down
2 changes: 2 additions & 0 deletions pkg/sessions/cookie/session_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import (

func TestSessionStore(t *testing.T) {
logger.SetOutput(GinkgoWriter)
logger.SetErrOutput(GinkgoWriter)

RegisterFailHandler(Fail)
RunSpecs(t, "Cookie SessionStore")
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/sessions/persistence/persistence_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (

func TestPersistenceSuite(t *testing.T) {
logger.SetOutput(GinkgoWriter)
logger.SetErrOutput(GinkgoWriter)

RegisterFailHandler(Fail)
RunSpecs(t, "Persistence")
}
1 change: 1 addition & 0 deletions pkg/sessions/redis/redis_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions pkg/sessions/session_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (

func TestSessionStore(t *testing.T) {
logger.SetOutput(GinkgoWriter)
logger.SetErrOutput(GinkgoWriter)

RegisterFailHandler(Fail)
RunSpecs(t, "SessionStore")
Expand Down
1 change: 1 addition & 0 deletions pkg/upstream/upstream_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ var (

func TestUpstreamSuite(t *testing.T) {
logger.SetOutput(GinkgoWriter)
logger.SetErrOutput(GinkgoWriter)
log.SetOutput(GinkgoWriter)

RegisterFailHandler(Fail)
Expand Down
1 change: 1 addition & 0 deletions pkg/validation/validation_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

func TestValidationSuite(t *testing.T) {
logger.SetOutput(GinkgoWriter)
logger.SetErrOutput(GinkgoWriter)

RegisterFailHandler(Fail)
RunSpecs(t, "Validation Suite")
Expand Down
1 change: 1 addition & 0 deletions providers/providers_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

func TestProviderSuite(t *testing.T) {
logger.SetOutput(GinkgoWriter)
logger.SetErrOutput(GinkgoWriter)

RegisterFailHandler(Fail)
RunSpecs(t, "Providers")
Expand Down

0 comments on commit b6cca79

Please sign in to comment.