@@ -277,7 +277,7 @@ func TestResolveLog(t *testing.T) {
277277 logLevel : "DEBUG" ,
278278 logPath : "./logs/nginx.log" ,
279279 expectedLogPath : "./logs/nginx.log" ,
280- expectedLogLevel : "debug " ,
280+ expectedLogLevel : "DEBUG " ,
281281 },
282282 }
283283
@@ -341,8 +341,6 @@ func TestResolveCollector(t *testing.T) {
341341}
342342
343343func TestResolveCollectorLog (t * testing.T ) {
344- viperInstance = viper .NewWithOptions (viper .KeyDelimiter (KeyDelimiter ))
345- viperInstance .SetDefault (CollectorLogLevelKey , DefCollectorLogLevel )
346344 tests := []struct {
347345 name string
348346 logLevel string
@@ -357,15 +355,15 @@ func TestResolveCollectorLog(t *testing.T) {
357355 logPath : "/tmp/collector.log" ,
358356 agentLogLevel : "debug" ,
359357 expectedLogPath : "/tmp/collector.log" ,
360- expectedLogLevel : "debug " ,
358+ expectedLogLevel : "DEBUG " ,
361359 },
362360 {
363361 name : "Test 2: Agent Log Level is Warn" ,
364362 logLevel : "" ,
365363 logPath : "/tmp/collector.log" ,
366364 agentLogLevel : "warn" ,
367365 expectedLogPath : "/tmp/collector.log" ,
368- expectedLogLevel : "INFO " ,
366+ expectedLogLevel : "WARN " ,
369367 },
370368 {
371369 name : "Test 3: OTel Log Level Set In Config" ,
@@ -379,6 +377,7 @@ func TestResolveCollectorLog(t *testing.T) {
379377
380378 for _ , test := range tests {
381379 t .Run (test .name , func (t * testing.T ) {
380+ viperInstance = viper .NewWithOptions (viper .KeyDelimiter (KeyDelimiter ))
382381 viperInstance .Set (CollectorLogPathKey , test .logPath )
383382 viperInstance .Set (LogLevelKey , test .agentLogLevel )
384383
0 commit comments