(t *testing.T)
| 618 | } |
| 619 | |
| 620 | func TestLogFlush(t *testing.T) { |
| 621 | // FIXME: CBG-1869 flaky test |
| 622 | t.Skip("CBG-1869: Flaky test") |
| 623 | |
| 624 | testCases := []struct { |
| 625 | Name string |
| 626 | ExpectedLogFileCount int |
| 627 | EnableFunc func(config StartupConfig) StartupConfig |
| 628 | }{ |
| 629 | { |
| 630 | "Default", |
| 631 | 4, |
| 632 | func(config StartupConfig) StartupConfig { |
| 633 | return config |
| 634 | }, |
| 635 | }, |
| 636 | { |
| 637 | "Add trace", |
| 638 | 5, |
| 639 | func(config StartupConfig) StartupConfig { |
| 640 | config.Logging.Trace = &base.FileLoggerConfig{ |
| 641 | Enabled: base.Ptr(true), |
| 642 | } |
| 643 | return config |
| 644 | }, |
| 645 | }, |
| 646 | { |
| 647 | "Add debug and trace", |
| 648 | 6, |
| 649 | func(config StartupConfig) StartupConfig { |
| 650 | config.Logging.Debug = &base.FileLoggerConfig{ |
| 651 | Enabled: base.Ptr(true), |
| 652 | } |
| 653 | config.Logging.Trace = &base.FileLoggerConfig{ |
| 654 | Enabled: base.Ptr(true), |
| 655 | } |
| 656 | return config |
| 657 | }, |
| 658 | }, |
| 659 | { |
| 660 | "Disable error", |
| 661 | 3, |
| 662 | func(config StartupConfig) StartupConfig { |
| 663 | config.Logging.Error = &base.FileLoggerConfig{ |
| 664 | Enabled: base.Ptr(false), |
| 665 | } |
| 666 | return config |
| 667 | }, |
| 668 | }, |
| 669 | } |
| 670 | |
| 671 | for _, testCase := range testCases { |
| 672 | t.Run(testCase.Name, func(t *testing.T) { |
| 673 | base.SetUpTestLogging(t, base.LevelInfo, base.KeyAll) |
| 674 | |
| 675 | // Setup memory logging |
| 676 | base.InitializeMemoryLoggers() |
| 677 |
nothing calls this directly
no test coverage detected