@@ -18,7 +18,7 @@ import (
1818
1919// TestLoadConfig tests configuratosn loading from various file formats
2020func TestLoadConfig (t * testing.T ) {
21- t . Parallel ()
21+
2222 tests := []struct {
2323 name string
2424 configData string
@@ -81,7 +81,7 @@ user = "testuser"
8181
8282 for _ , tt := range tests {
8383 t .Run (tt .name , func (t * testing.T ) {
84- t . Parallel ()
84+
8585 // Create a new viper instance for isolation
8686 oldConfig := Config
8787 Config = viper .New ()
@@ -106,7 +106,7 @@ user = "testuser"
106106
107107// TestMustLoadConfig tests panic behavior
108108func TestMustLoadConfig (t * testing.T ) {
109- t . Parallel ()
109+
110110 t .Run ("valid config" , func (t * testing.T ) {
111111 // Create a new viper instance for isolation
112112 oldConfig := Config
@@ -124,7 +124,7 @@ func TestMustLoadConfig(t *testing.T) {
124124 })
125125
126126 t .Run ("invalid config path" , func (t * testing.T ) {
127- t . Parallel ()
127+
128128 // Create a new viper instance for isolation
129129 oldConfig := Config
130130 Config = viper .New ()
@@ -138,7 +138,7 @@ func TestMustLoadConfig(t *testing.T) {
138138
139139// TestLoadWithDefaults tests loading with default values
140140func TestLoadWithDefaults (t * testing.T ) {
141- t . Parallel ()
141+
142142 // Create a new viper instance for isolation
143143 oldConfig := Config
144144 Config = viper .New ()
@@ -182,7 +182,7 @@ database:
182182
183183// TestBindEnv tests environment variable binding
184184func TestBindEnv (t * testing.T ) {
185- t . Parallel ()
185+
186186 // Create a new viper instance for isolation
187187 oldConfig := Config
188188 Config = viper .New ()
@@ -213,7 +213,7 @@ func TestBindEnv(t *testing.T) {
213213
214214 for _ , tt := range tests {
215215 t .Run (tt .name , func (t * testing.T ) {
216- t . Parallel ()
216+
217217 // Set environment variable
218218 _ = os .Setenv (tt .envVar , tt .value )
219219 defer func () { _ = os .Unsetenv (tt .envVar ) }()
@@ -228,7 +228,7 @@ func TestBindEnv(t *testing.T) {
228228
229229// TestBindEnvs tests batch environment variable binding
230230func TestBindEnvs (t * testing.T ) {
231- t . Parallel ()
231+
232232 // Create a new viper instance for isolation
233233 oldConfig := Config
234234 Config = viper .New ()
@@ -262,7 +262,7 @@ func TestBindEnvs(t *testing.T) {
262262
263263// TestWatchConfig tests configuration file watching
264264func TestWatchConfig (t * testing.T ) {
265- t . Parallel ()
265+
266266 // Create a new viper instance for isolation
267267 oldConfig := Config
268268 Config = viper .New ()
@@ -306,15 +306,15 @@ func TestWatchConfig(t *testing.T) {
306306
307307// TestGetConfigHelpers tests the various getter helper functions
308308func TestGetConfigHelpers (t * testing.T ) {
309- t . Parallel ()
309+
310310 // Create a new viper instance for isolation
311311 oldConfig := Config
312312 Config = viper .New ()
313313 defer func () { Config = oldConfig }()
314314
315315 // Test GetString with required flag
316316 t .Run ("GetString" , func (t * testing.T ) {
317- t . Parallel ()
317+
318318 Config .Set ("test.string" , "value" )
319319 assert .Equal (t , "value" , GetString ("test.string" , false ))
320320 assert .Equal (t , "" , GetString ("nonexistent" , false ))
@@ -327,7 +327,7 @@ func TestGetConfigHelpers(t *testing.T) {
327327
328328 // Test GetDuration
329329 t .Run ("GetDuration" , func (t * testing.T ) {
330- t . Parallel ()
330+
331331 Config .Set ("test.duration" , "5m" )
332332 assert .Equal (t , 5 * time .Minute , GetDuration ("test.duration" , 0 ))
333333 assert .Equal (t , 10 * time .Second , GetDuration ("nonexistent" , 10 * time .Second ))
@@ -336,7 +336,7 @@ func TestGetConfigHelpers(t *testing.T) {
336336
337337 // Test viper's built-in getters
338338 t .Run ("ViperGetters" , func (t * testing.T ) {
339- t . Parallel ()
339+
340340 Config .Set ("test.bool" , true )
341341 Config .Set ("test.int" , 42 )
342342 Config .Set ("test.slice" , []string {"a" , "b" , "c" })
@@ -349,7 +349,7 @@ func TestGetConfigHelpers(t *testing.T) {
349349
350350// TestRequiredConfig tests required configuration validation
351351func TestRequiredConfig (t * testing.T ) {
352- t . Parallel ()
352+
353353 // Create a new viper instance for isolation
354354 oldConfig := Config
355355 Config = viper .New ()
@@ -358,7 +358,7 @@ func TestRequiredConfig(t *testing.T) {
358358 Config .Set ("existing.key" , "value" )
359359
360360 t .Run ("Require" , func (t * testing.T ) {
361- t . Parallel ()
361+
362362 err := Require ("existing.key" )
363363 assert .NoError (t , err )
364364
@@ -373,7 +373,7 @@ func TestRequiredConfig(t *testing.T) {
373373 })
374374
375375 t .Run ("MustRequire" , func (t * testing.T ) {
376- t . Parallel ()
376+
377377 Config .Set ("test.key" , "value" )
378378
379379 // Should not panic
@@ -390,7 +390,7 @@ func TestRequiredConfig(t *testing.T) {
390390
391391// TestGetAllSettings tests retrieving all configuration
392392func TestGetAllSettings (t * testing.T ) {
393- t . Parallel ()
393+
394394 // Create a new viper instance for isolation
395395 oldConfig := Config
396396 Config = viper .New ()
@@ -413,7 +413,7 @@ func TestGetAllSettings(t *testing.T) {
413413
414414// TestIsSet tests configuration key existence checks
415415func TestIsSet (t * testing.T ) {
416- t . Parallel ()
416+
417417 // Create a new viper instance for isolation
418418 oldConfig := Config
419419 Config = viper .New ()
@@ -435,7 +435,7 @@ func TestIsSet(t *testing.T) {
435435// TestConcurrentAccess tests thread-safe configuration access
436436// NOTE: Viper doesn't support concurrent writes without external synchronization
437437func TestConcurrentAccess (t * testing.T ) {
438- t . Parallel ()
438+
439439 t .Skip ("Viper doesn't support concurrent writes without external synchronization" )
440440 // Create a new viper instance for isolation
441441 oldConfig := Config
@@ -488,7 +488,7 @@ func TestConcurrentAccess(t *testing.T) {
488488
489489// TestConfigPriority tests configuration source priority
490490func TestConfigPriority (t * testing.T ) {
491- t . Parallel ()
491+
492492 t .Skip ("Viper's environment binding behavior is complex and varies by version" )
493493
494494 // Create a new viper instance for isolation
@@ -510,7 +510,7 @@ func TestConfigPriority(t *testing.T) {
510510
511511// TestUnmarshalKey tests unmarshaling specific config sections
512512func TestUnmarshalKey (t * testing.T ) {
513- t . Parallel ()
513+
514514 // Create a new viper instance for isolation
515515 oldConfig := Config
516516 Config = viper .New ()
@@ -539,7 +539,7 @@ func TestUnmarshalKey(t *testing.T) {
539539
540540// TestSubConfig tests working with configuration sub-trees
541541func TestSubConfig (t * testing.T ) {
542- t . Parallel ()
542+
543543 // Create a new viper instance for isolation
544544 oldConfig := Config
545545 Config = viper .New ()
@@ -566,7 +566,7 @@ func TestSubConfig(t *testing.T) {
566566// TestConfigValidation tests configuration validation scenarios
567567// TestWatchAndHotReload tests the configuration hot reload functionality
568568func TestWatchAndHotReload (t * testing.T ) {
569- t . Parallel ()
569+
570570 // Create a new viper instance for isolation
571571 oldConfig := Config
572572 Config = viper .New ()
@@ -608,7 +608,7 @@ func TestWatchAndHotReload(t *testing.T) {
608608
609609// TestReload tests the configuration reload functionality
610610func TestReload (t * testing.T ) {
611- t . Parallel ()
611+
612612 // Create a new viper instance for isolation
613613 oldConfig := Config
614614 Config = viper .New ()
@@ -640,7 +640,7 @@ func TestReload(t *testing.T) {
640640
641641// TestSetDefaultEnvPrefix tests environment variable prefix configuration
642642func TestSetDefaultEnvPrefix (t * testing.T ) {
643- t . Parallel ()
643+
644644 // Create a new viper instance for isolation
645645 oldConfig := Config
646646 Config = viper .New ()
@@ -658,7 +658,7 @@ func TestSetDefaultEnvPrefix(t *testing.T) {
658658}
659659
660660func TestConfigValidation (t * testing.T ) {
661- t . Parallel ()
661+
662662 tests := []struct {
663663 name string
664664 setupFunc func ()
@@ -716,7 +716,7 @@ func TestConfigValidation(t *testing.T) {
716716
717717 for _ , tt := range tests {
718718 t .Run (tt .name , func (t * testing.T ) {
719- t . Parallel ()
719+
720720 // Create a new viper instance for isolation
721721 oldConfig := Config
722722 Config = viper .New ()
0 commit comments