Skip to content

Commit 260b822

Browse files
authored
Merge pull request kubernetes-sigs#2333 from lucacome/tests-0.27.2
🌱 Re-enable tests for v0.27.2
2 parents 1fe22d0 + c8b911b commit 260b822

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

pkg/log/zap/zap_test.go

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ type fakeSyncWriter bool
4545
func (w *fakeSyncWriter) Write(p []byte) (int, error) {
4646
return len(p), nil
4747
}
48+
4849
func (w *fakeSyncWriter) Sync() error {
4950
*w = true
5051
return nil
@@ -209,8 +210,6 @@ var _ = Describe("Zap logger setup", func() {
209210
})
210211

211212
It("should log a standard non-namespaced NamespacedName name", func() {
212-
Skip("Skipping until we bumped k/k to v0.27.2")
213-
214213
name := types.NamespacedName{Name: "some-node"}
215214
logger.Info("here's a kubernetes object", "thing", name)
216215

@@ -245,8 +244,6 @@ var _ = Describe("Zap logger setup", func() {
245244
})
246245

247246
It("should log a standard namespaced NamespacedName name and namespace", func() {
248-
Skip("Skipping until we bumped k/k to v0.27.2")
249-
250247
name := types.NamespacedName{Name: "some-pod", Namespace: "some-ns"}
251248
logger.Info("here's a kubernetes object", "thing", name)
252249

@@ -277,7 +274,6 @@ var _ = Describe("Zap logger setup", func() {
277274
logger = New(WriteTo(logOut), UseDevMode(false))
278275
})
279276
defineTests()
280-
281277
})
282278
})
283279
})
@@ -313,7 +309,6 @@ var _ = Describe("Zap log level flag options setup", func() {
313309

314310
Expect(string(outRaw)).Should(ContainSubstring(logInfoLevel0))
315311
Expect(string(outRaw)).Should(ContainSubstring(logDebugLevel1))
316-
317312
})
318313

319314
It("Should output only error logs, otherwise empty logs", func() {
@@ -332,7 +327,6 @@ var _ = Describe("Zap log level flag options setup", func() {
332327

333328
Expect(outRaw).To(BeEmpty())
334329
})
335-
336330
})
337331

338332
Context("with zap-log-level with increased verbosity.", func() {
@@ -389,7 +383,6 @@ var _ = Describe("Zap log level flag options setup", func() {
389383
Expect(string(outRaw)).Should(ContainSubstring(logDebugLevel1))
390384
Expect(string(outRaw)).Should(ContainSubstring(logDebugLevel2))
391385
Expect(string(outRaw)).Should(ContainSubstring(logDebugLevel3))
392-
393386
})
394387
It("Should output info, and debug logs with increased verbosity, and with production mode set to true.", func() {
395388
args := []string{"--zap-log-level=3", "--zap-devel=true"}
@@ -410,13 +403,10 @@ var _ = Describe("Zap log level flag options setup", func() {
410403
Expect(string(outRaw)).Should(ContainSubstring(logDebugLevel1))
411404
Expect(string(outRaw)).Should(ContainSubstring(logDebugLevel2))
412405
Expect(string(outRaw)).Should(ContainSubstring(logDebugLevel3))
413-
414406
})
415-
416407
})
417408

418409
Context("with zap-stacktrace-level options provided", func() {
419-
420410
It("Should output stacktrace at info level, with development mode set to true.", func() {
421411
args := []string{"--zap-stacktrace-level=info", "--zap-devel=true"}
422412
fromFlags.BindFlags(&fs)
@@ -451,7 +441,6 @@ var _ = Describe("Zap log level flag options setup", func() {
451441
Expect(out.StacktraceLevel.Enabled(zapcore.ErrorLevel)).To(BeFalse())
452442
Expect(out.StacktraceLevel.Enabled(zapcore.InfoLevel)).To(BeFalse())
453443
})
454-
455444
})
456445

457446
Context("with only -zap-devel flag provided", func() {
@@ -484,12 +473,10 @@ var _ = Describe("Zap log level flag options setup", func() {
484473
Expect(out.Level).To(BeNil())
485474
Expect(out.StacktraceLevel).To(BeNil())
486475
Expect(out.EncoderConfigOptions).To(BeNil())
487-
488476
})
489477
})
490478

491479
Context("with zap-time-encoding flag provided", func() {
492-
493480
It("Should set time encoder in options", func() {
494481
args := []string{"--zap-time-encoding=rfc3339"}
495482
fromFlags.BindFlags(&fs)
@@ -549,11 +536,9 @@ var _ = Describe("Zap log level flag options setup", func() {
549536
Expect(json.Unmarshal(outRaw, &res)).To(Succeed())
550537
Expect(res["ts"]).Should(MatchRegexp(iso8601Pattern))
551538
})
552-
553539
})
554540

555541
Context("with encoder options provided programmatically", func() {
556-
557542
It("Should set JSON Encoder, with given Millis TimeEncoder option, and MessageKey", func() {
558543
logOut := new(bytes.Buffer)
559544
f := func(ec *zapcore.EncoderConfig) {

0 commit comments

Comments
 (0)