Skip to content

Commit

Permalink
Adapt changes for logger changed to construct
Browse files Browse the repository at this point in the history
  • Loading branch information
acumino committed Jul 19, 2022
1 parent 2cc0e5d commit d219d44
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func New(config *Config) (logr.Logger, error) {

zapLog, err := zapCfg.Build(zap.AddCallerSkip(1))
if err != nil {
return nil, err
return logr.Logger{}, err
}
return zapr.NewLogger(zapLog), nil
}
Expand Down
5 changes: 3 additions & 2 deletions pkg/testrunner/result/summary-poster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package result

import (
"github.com/go-logr/logr"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

Expand Down Expand Up @@ -44,7 +45,7 @@ var _ = Describe("summary-poster", func() {
runs = append(runs, run)
items := parseTestrunsToTableItems(runs)
Expect(items).To(HaveLen(1))
slack, err := util.RenderTableForSlack(nil, items)
slack, err := util.RenderTableForSlack(logr.Logger{}, items)
Expect(err).ToNot(HaveOccurred())
Expect(slack).To(ContainSubstring(string(util.StatusSymbolSuccess)))
Expect(slack).ToNot(ContainSubstring(string(util.StatusSymbolNA)))
Expand Down Expand Up @@ -82,7 +83,7 @@ var _ = Describe("summary-poster", func() {
runs = append(runs, run)
items := parseTestrunsToTableItems(runs)
Expect(items).To(HaveLen(2))
slack, err := util.RenderTableForSlack(nil, items)
slack, err := util.RenderTableForSlack(logr.Logger{}, items)
Expect(err).ToNot(HaveOccurred())
Expect(slack).To(ContainSubstring(string(util.StatusSymbolSuccess) + util.SymbolOffset + string(util.StatusSymbolFailure)))
Expect(slack).ToNot(ContainSubstring(string(util.StatusSymbolNA)))
Expand Down
3 changes: 2 additions & 1 deletion pkg/util/slack-table-post_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package util_test

import (
"github.com/go-logr/logr"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

Expand Down Expand Up @@ -55,7 +56,7 @@ var _ = Describe("Slack Table Post", func() {
StatusSymbol: util.StatusSymbolSuccess,
}
tis := []*util.TableItem{&ti}
table, err := util.RenderTableForSlack(nil, tis)
table, err := util.RenderTableForSlack(logr.Logger{}, tis)
Expect(err).ToNot(HaveOccurred())
Expect(table).To(ContainSubstring("(orange)"))
Expect(table).To(ContainSubstring("[para]"))
Expand Down

0 comments on commit d219d44

Please sign in to comment.