@@ -686,6 +686,7 @@ license_key: "xxx"
686686
687687 tmp , err := createTestFile (yamlData )
688688 require .NoError (t , err )
689+
689690 defer os .Remove (tmp .Name ())
690691
691692 cfg , err := LoadConfig (tmp .Name ())
@@ -695,13 +696,15 @@ license_key: "xxx"
695696 assert .Equal (t , "xxx" , cfg .License )
696697 assert .Equal (t , "agent.log" , cfg .LogFile )
697698 assert .Equal (t , "json" , cfg .LogFormat )
698- assert .Equal ( t , true , cfg .LogToStdout )
699+ assert .True ( t , cfg .LogToStdout )
699700 assert .Equal (t , 5 , cfg .SmartVerboseModeEntryLimit )
700701 assert .Equal (t , SmartVerboseLogging , cfg .Verbose )
701702 assert .Equal (t , LogLevelSmart , cfg .Log .Level )
702703}
703704
704705func TestLoadYamlConfig_withLogFormat (t * testing.T ) {
706+ t .Parallel ()
707+
705708 yamlData := []byte (`
706709log:
707710 file: agent.log
@@ -713,6 +716,7 @@ license_key: "xxx"
713716
714717 tmp , err := createTestFile (yamlData )
715718 require .NoError (t , err )
719+
716720 defer os .Remove (tmp .Name ())
717721
718722 cfg , err := LoadConfig (tmp .Name ())
@@ -722,7 +726,7 @@ license_key: "xxx"
722726 assert .Equal (t , "xxx" , cfg .License )
723727 assert .Equal (t , "agent.log" , cfg .LogFile )
724728 assert .Equal (t , "json" , cfg .LogFormat )
725- assert .Equal ( t , true , cfg .LogToStdout )
729+ assert .True ( t , cfg .LogToStdout )
726730 assert .Equal (t , 5 , cfg .SmartVerboseModeEntryLimit )
727731 assert .Equal (t , LogLevelWarn , cfg .Log .Level )
728732}
@@ -800,10 +804,10 @@ func TestLoadLogConfig_BackwardsCompatability(t *testing.T) {
800804 {"Trace and forward enabled" , Config {Log : LogConfig {Level : "trace" , Forward : toPtr (true )}}, TraceTroubleshootLogging },
801805 }
802806
803- //nolint:rangevarcopies
804807 for i := range logConfigs {
805808 tt := & logConfigs [i ]
806809 t .Run (tt .name , func (t * testing.T ) {
810+ t .Parallel ()
807811 assert .Equal (t , NonVerboseLogging , tt .c .Verbose )
808812 tt .c .loadLogConfig ()
809813 assert .Equal (t , tt .verbose , tt .c .Verbose )
@@ -830,10 +834,10 @@ func TestLoadLogConfig_Populate(t *testing.T) {
830834 {"Trace Verbose enabled and file" , Config {Verbose : 4 , LogFile : "agent.log" }, LogConfig {Level : LogLevelTrace , File : "agent.log" , ToStdout : boolPtr (false ), Forward : boolPtr (false ), ExcludeFilters : LogFilters {"traces" : []interface {}{"supervisor" , "feature" , "process" }, "component" : []interface {}{"integration-errors" }}, SmartLevelEntryLimit : intPtr (0 )}},
831835 }
832836
833- //nolint:rangevarcopies
834837 for i := range configs {
835838 tt := & configs [i ]
836839 t .Run (tt .name , func (t * testing.T ) {
840+ t .Parallel ()
837841 tt .c .loadLogConfig ()
838842 assert .Equal (t , tt .expectedLogConfig , tt .c .Log )
839843 })
0 commit comments