Procházet zdrojové kódy

check return value from `unmarshalRoot` in test and fail if false

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Andrew Savinykh před 4 měsíci
rodič
revize
f58eeef49d
1 změnil soubory, kde provedl 4 přidání a 1 odebrání
  1. 4 1
      service/internal/config/config_reloader_test.go

+ 4 - 1
service/internal/config/config_reloader_test.go

@@ -99,7 +99,10 @@ func TestEnvInConfig(t *testing.T) {
 			t.Errorf("Error loading YAML: %v", err)
 			continue
 		}
-		unmarshalRoot(k, cfg)
+		if !unmarshalRoot(k, cfg) {
+			t.Errorf("Error unmarshalling config for env=%q", tt.input)
+			continue
+		}
 		field := tt.selector(cfg)
 		assert.Equal(t, tt.output, field,
 			"Unmarshaled config field doesn't match expected value: env=%q", tt.input)