Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersonQ committed Aug 23, 2024
1 parent 315bf99 commit 680661a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ func TestDownloadLogProgressWithLength(t *testing.T) {
)

// Consider only progress logs
obs = obs.Filter(func(entry observer.LoggedEntry) bool {
obs = &logger.ObservedLogs{ObservedLogs: obs.Filter(func(entry observer.LoggedEntry) bool {
return expectedProgressRegexp.MatchString(entry.Message) ||
expectedCompletedRegexp.MatchString(entry.Message)
})
})}

// Two files are downloaded. Each file is being downloaded in 100 chunks with a delay of 10ms between chunks. The
// expected time to download is, therefore, 100 * 10ms = 1000ms. In reality, the actual download time will be a bit
Expand Down Expand Up @@ -265,10 +265,10 @@ func TestDownloadLogProgressWithoutLength(t *testing.T) {
)

// Consider only progress logs
obs = obs.Filter(func(entry observer.LoggedEntry) bool {
obs = &logger.ObservedLogs{ObservedLogs: obs.Filter(func(entry observer.LoggedEntry) bool {
return expectedProgressRegexp.MatchString(entry.Message) ||
expectedCompletedRegexp.MatchString(entry.Message)
})
})}

// Two files are downloaded. Each file is being downloaded in 100 chunks with a delay of 10ms between chunks. The
// expected time to download is, therefore, 100 * 10ms = 1000ms. In reality, the actual download time will be a bit
Expand Down
2 changes: 1 addition & 1 deletion pkg/core/logger/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func NewTesting(name string) (*Logger, *ObservedLogs) {
return zapcore.NewTee(in, core)
}))

return logger, &ObservedLogs{obs}
return logger, &ObservedLogs{ObservedLogs: obs}
}

// PrettyPrintf consumes, formats and prints all captured log messages using the provided
Expand Down

0 comments on commit 680661a

Please sign in to comment.