-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathconfig_test.go
More file actions
732 lines (617 loc) · 20.6 KB
/
config_test.go
File metadata and controls
732 lines (617 loc) · 20.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
package cmd
import (
"bytes"
"encoding/json"
"os"
"slices"
"strings"
"testing"
"gopkg.in/yaml.v3"
"github.com/timescale/tiger-cli/internal/tiger/config"
)
func setupConfigTest(t *testing.T) (string, func()) {
t.Helper()
// Create temporary directory for test config
tmpDir, err := os.MkdirTemp("", "tiger-config-test-*")
if err != nil {
t.Fatalf("Failed to create temp dir: %v", err)
}
// Set environment variable to use test directory
os.Setenv("TIGER_CONFIG_DIR", tmpDir)
config.UseTestConfig(tmpDir, map[string]any{})
// Clean up function
cleanup := func() {
os.RemoveAll(tmpDir)
os.Unsetenv("TIGER_CONFIG_DIR")
// Reset global config in the config package
// This is important for test isolation
// We need to clear the singleton
config.ResetGlobalConfig()
}
t.Cleanup(cleanup)
return tmpDir, cleanup
}
func executeConfigCommand(args ...string) (string, error) {
// Use buildRootCmd() to get a complete root command with all flags and subcommands
testRoot := buildRootCmd()
buf := new(bytes.Buffer)
testRoot.SetOut(buf)
testRoot.SetErr(buf)
testRoot.SetArgs(args)
err := testRoot.Execute()
return buf.String(), err
}
func TestConfigShow_TableOutput(t *testing.T) {
tmpDir, _ := setupConfigTest(t)
// Create config file with test data
configContent := `api_url: https://test.api.com/v1
project_id: test-project
service_id: test-service
output: table
analytics: false
password_storage: pgpass
`
configFile := config.GetConfigFile(tmpDir)
if err := os.WriteFile(configFile, []byte(configContent), 0644); err != nil {
t.Fatalf("Failed to write config file: %v", err)
}
output, err := executeConfigCommand("config", "show")
if err != nil {
t.Fatalf("Command failed: %v", err)
}
lines := strings.Split(output, "\n")
// Check table output contains all expected key:value lines
expectedLines := []string{
" api_url: https://test.api.com/v1",
" console_url: https://console.cloud.timescale.com",
" gateway_url: https://console.cloud.timescale.com/api",
" docs_mcp: true",
" docs_mcp_url: https://mcp.tigerdata.com/docs",
" project_id: test-project",
" service_id: test-service",
" output: table",
" analytics: false",
" password_storage: pgpass",
" debug: false",
" config_dir: " + tmpDir,
}
for _, expectedLine := range expectedLines {
if !slices.Contains(lines, expectedLine) {
t.Errorf("Output should contain line '%s', got: %s", expectedLine, output)
}
}
}
func TestConfigShow_JSONOutput(t *testing.T) {
tmpDir, _ := setupConfigTest(t)
// Create config file with JSON output format
configContent := `api_url: https://json.api.com/v1
project_id: json-project
output: json
analytics: true
password_storage: none
`
configFile := config.GetConfigFile(tmpDir)
if err := os.WriteFile(configFile, []byte(configContent), 0644); err != nil {
t.Fatalf("Failed to write config file: %v", err)
}
output, err := executeConfigCommand("config", "show")
if err != nil {
t.Fatalf("Command failed: %v", err)
}
// Parse JSON output
var result map[string]interface{}
if err := json.Unmarshal([]byte(output), &result); err != nil {
t.Fatalf("Failed to parse JSON output: %v", err)
}
// Verify ALL JSON keys and their expected values
expectedValues := map[string]interface{}{
"api_url": "https://json.api.com/v1",
"console_url": "https://console.cloud.timescale.com",
"gateway_url": "https://console.cloud.timescale.com/api",
"docs_mcp": true,
"docs_mcp_url": "https://mcp.tigerdata.com/docs",
"project_id": "json-project",
"service_id": "",
"output": "json",
"analytics": true,
"password_storage": "none",
"debug": false,
"config_dir": tmpDir,
}
for key, expectedValue := range expectedValues {
if result[key] != expectedValue {
t.Errorf("Expected %s '%v', got %v", key, expectedValue, result[key])
}
}
// Ensure no extra keys are present
if len(result) != len(expectedValues) {
t.Errorf("Expected %d keys in JSON output, got %d", len(expectedValues), len(result))
}
}
func TestConfigShow_YAMLOutput(t *testing.T) {
tmpDir, _ := setupConfigTest(t)
// Create config file with YAML output format
configContent := `api_url: https://yaml.api.com/v1
project_id: yaml-project
output: yaml
analytics: false
password_storage: keyring
`
configFile := config.GetConfigFile(tmpDir)
if err := os.WriteFile(configFile, []byte(configContent), 0644); err != nil {
t.Fatalf("Failed to write config file: %v", err)
}
output, err := executeConfigCommand("config", "show")
if err != nil {
t.Fatalf("Command failed: %v", err)
}
// Parse YAML output
var result map[string]interface{}
if err := yaml.Unmarshal([]byte(output), &result); err != nil {
t.Fatalf("Failed to parse YAML output: %v", err)
}
// Verify ALL YAML keys and their expected values
expectedValues := map[string]interface{}{
"api_url": "https://yaml.api.com/v1",
"console_url": "https://console.cloud.timescale.com",
"gateway_url": "https://console.cloud.timescale.com/api",
"docs_mcp": true,
"docs_mcp_url": "https://mcp.tigerdata.com/docs",
"project_id": "yaml-project",
"service_id": "",
"output": "yaml",
"analytics": false,
"password_storage": "keyring",
"debug": false,
"config_dir": tmpDir,
}
for key, expectedValue := range expectedValues {
if result[key] != expectedValue {
t.Errorf("Expected %s '%v', got %v", key, expectedValue, result[key])
}
}
// Ensure no extra keys are present
if len(result) != len(expectedValues) {
t.Errorf("Expected %d keys in YAML output, got %d", len(expectedValues), len(result))
}
}
func TestConfigShow_EmptyValues(t *testing.T) {
tmpDir, _ := setupConfigTest(t)
// Create minimal config (only defaults)
configContent := `output: table
analytics: true
`
configFile := config.GetConfigFile(tmpDir)
if err := os.WriteFile(configFile, []byte(configContent), 0644); err != nil {
t.Fatalf("Failed to write config file: %v", err)
}
output, err := executeConfigCommand("config", "show")
if err != nil {
t.Fatalf("Command failed: %v", err)
}
// Check that empty values show "(not set)"
if !strings.Contains(output, "(not set)") {
t.Error("Output should contain '(not set)' for empty values")
}
}
func TestConfigShow_ConfigDirFlag(t *testing.T) {
setupConfigTest(t)
// Create a different temporary directory for the --config-dir flag, which
// should override the value provided via the TIGER_CONFIG_DIR env var in
// setupConfigTest
tmpDir, err := os.MkdirTemp("", "tiger-config-test-*")
if err != nil {
t.Fatalf("Failed to create temp dir: %v", err)
}
t.Cleanup(func() {
os.RemoveAll(tmpDir)
})
// Create a config file with test data in the specified directory
configContent := `api_url: https://flag-test.api.com/v1
project_id: flag-test-project
output: json
analytics: false
`
configFile := config.GetConfigFile(tmpDir)
if err := os.WriteFile(configFile, []byte(configContent), 0644); err != nil {
t.Fatalf("Failed to write config file: %v", err)
}
// Execute config show with --config-dir flag
output, err := executeConfigCommand("--config-dir", tmpDir, "config", "show")
if err != nil {
t.Fatalf("Command failed: %v", err)
}
// Parse JSON output and verify values
var result map[string]interface{}
if err := json.Unmarshal([]byte(output), &result); err != nil {
t.Fatalf("Failed to parse JSON output: %v", err)
}
if result["project_id"] != "flag-test-project" {
t.Errorf("Expected project_id 'flag-test-project', got %v", result["project_id"])
}
if result["api_url"] != "https://flag-test.api.com/v1" {
t.Errorf("Expected api_url 'https://flag-test.api.com/v1', got %v", result["api_url"])
}
if result["config_dir"] != tmpDir {
t.Errorf("Expected config_dir '%s', got %v", tmpDir, result["config_dir"])
}
}
func TestConfigSet_ValidValues(t *testing.T) {
_, _ = setupConfigTest(t)
tests := []struct {
key string
value string
expectedOutput string
}{
{"api_url", "https://new.api.com/v1", "Set api_url = https://new.api.com/v1"},
{"project_id", "new-project", "Set project_id = new-project"},
{"service_id", "new-service", "Set service_id = new-service"},
{"output", "json", "Set output = json"},
{"analytics", "false", "Set analytics = false"},
{"password_storage", "pgpass", "Set password_storage = pgpass"},
{"password_storage", "none", "Set password_storage = none"},
{"password_storage", "keyring", "Set password_storage = keyring"},
}
for _, tt := range tests {
t.Run(tt.key+"="+tt.value, func(t *testing.T) {
output, err := executeConfigCommand("config", "set", tt.key, tt.value)
if err != nil {
t.Fatalf("Command failed: %v", err)
}
if !strings.Contains(output, tt.expectedOutput) {
t.Errorf("Expected output to contain '%s', got '%s'", tt.expectedOutput, strings.TrimSpace(output))
}
// Verify the value was actually set
cfg, err := config.Load()
if err != nil {
t.Fatalf("Failed to load config: %v", err)
}
// Check the value was set correctly
switch tt.key {
case "api_url":
if cfg.APIURL != tt.value {
t.Errorf("Expected APIURL %s, got %s", tt.value, cfg.APIURL)
}
case "project_id":
if cfg.ProjectID != tt.value {
t.Errorf("Expected ProjectID %s, got %s", tt.value, cfg.ProjectID)
}
case "service_id":
if cfg.ServiceID != tt.value {
t.Errorf("Expected ServiceID %s, got %s", tt.value, cfg.ServiceID)
}
case "output":
if cfg.Output != tt.value {
t.Errorf("Expected Output %s, got %s", tt.value, cfg.Output)
}
case "analytics":
expected := tt.value == "true"
if cfg.Analytics != expected {
t.Errorf("Expected Analytics %t, got %t", expected, cfg.Analytics)
}
case "password_storage":
if cfg.PasswordStorage != tt.value {
t.Errorf("Expected PasswordStorage %s, got %s", tt.value, cfg.PasswordStorage)
}
default:
t.Fatalf("Unhandled test case for key: %s", tt.key)
}
})
}
}
func TestConfigSet_InvalidValues(t *testing.T) {
_, _ = setupConfigTest(t)
tests := []struct {
key string
value string
error string
}{
{"output", "invalid", "invalid output format"},
{"analytics", "maybe", "invalid analytics value"},
{"password_storage", "invalid", "invalid password_storage value"},
{"password_storage", "secure", "invalid password_storage value"},
{"unknown", "value", "unknown configuration key"},
}
for _, tt := range tests {
t.Run(tt.key+"="+tt.value, func(t *testing.T) {
_, err := executeConfigCommand("config", "set", tt.key, tt.value)
if err == nil {
t.Error("Expected command to fail, but it succeeded")
}
if !strings.Contains(err.Error(), tt.error) {
t.Errorf("Expected error to contain '%s', got '%s'", tt.error, err.Error())
}
})
}
}
func TestConfigSet_WrongArgs(t *testing.T) {
_, _ = setupConfigTest(t)
// Test with no arguments
_, err := executeConfigCommand("config", "set")
if err == nil {
t.Error("Expected command to fail with no arguments")
}
// Test with one argument
_, err = executeConfigCommand("config", "set", "key")
if err == nil {
t.Error("Expected command to fail with only one argument")
}
// Test with too many arguments
_, err = executeConfigCommand("config", "set", "key", "value", "extra")
if err == nil {
t.Error("Expected command to fail with too many arguments")
}
}
func TestConfigSet_ConfigDirFlag(t *testing.T) {
setupConfigTest(t)
// Create a different temporary directory for the --config-dir flag, which
// should override the value provided via the TIGER_CONFIG_DIR env var in
// setupConfigTest
tmpDir, err := os.MkdirTemp("", "tiger-config-test-*")
if err != nil {
t.Fatalf("Failed to create temp dir: %v", err)
}
t.Cleanup(func() {
os.RemoveAll(tmpDir)
})
// Execute config set with --config-dir flag
if _, err := executeConfigCommand("--config-dir", tmpDir, "config", "set", "project_id", "flag-set-project"); err != nil {
t.Fatalf("Config set command failed: %v", err)
}
// Verify the config file was created in the specified directory
configFile := config.GetConfigFile(tmpDir)
if _, err := os.Stat(configFile); os.IsNotExist(err) {
t.Fatalf("Config file should exist at %s", configFile)
}
// Read the config file and verify the value was saved
content, err := os.ReadFile(configFile)
if err != nil {
t.Fatalf("Failed to read config file: %v", err)
}
if !strings.Contains(string(content), "project_id: flag-set-project") {
t.Errorf("Config file should contain 'project_id: flag-set-project', got: %s", string(content))
}
}
func TestConfigUnset_ValidKeys(t *testing.T) {
_, _ = setupConfigTest(t)
// First set some values
cfg, err := config.Load()
if err != nil {
t.Fatalf("Failed to load config: %v", err)
}
cfg.Set("project_id", "test-project")
cfg.Set("service_id", "test-service")
cfg.Set("output", "json")
cfg.Set("password_storage", "pgpass")
tests := []struct {
key string
expectedOutput string
}{
{"project_id", "Unset project_id"},
{"service_id", "Unset service_id"},
{"output", "Unset output"},
{"password_storage", "Unset password_storage"},
}
for _, tt := range tests {
t.Run(tt.key, func(t *testing.T) {
output, err := executeConfigCommand("config", "unset", tt.key)
if err != nil {
t.Fatalf("Command failed: %v", err)
}
if !strings.Contains(output, tt.expectedOutput) {
t.Errorf("Expected output to contain '%s', got '%s'", tt.expectedOutput, strings.TrimSpace(output))
}
// Verify the value was actually unset
cfg, err := config.Load()
if err != nil {
t.Fatalf("Failed to load config: %v", err)
}
// Check the value was unset correctly
switch tt.key {
case "project_id":
if cfg.ProjectID != "" {
t.Errorf("Expected empty ProjectID, got %s", cfg.ProjectID)
}
case "service_id":
if cfg.ServiceID != "" {
t.Errorf("Expected empty ServiceID, got %s", cfg.ServiceID)
}
case "output":
if cfg.Output != config.DefaultOutput {
t.Errorf("Expected default Output %s, got %s", config.DefaultOutput, cfg.Output)
}
case "password_storage":
if cfg.PasswordStorage != config.DefaultPasswordStorage {
t.Errorf("Expected default PasswordStorage %s, got %s", config.DefaultPasswordStorage, cfg.PasswordStorage)
}
default:
t.Fatalf("Unhandled test case for key: %s", tt.key)
}
})
}
}
func TestConfigUnset_InvalidKey(t *testing.T) {
_, _ = setupConfigTest(t)
_, err := executeConfigCommand("config", "unset", "unknown_key")
if err == nil {
t.Error("Expected command to fail with unknown key")
}
if !strings.Contains(err.Error(), "unknown configuration key") {
t.Errorf("Expected error about unknown key, got: %s", err.Error())
}
}
func TestConfigUnset_WrongArgs(t *testing.T) {
_, _ = setupConfigTest(t)
// Test with no arguments
_, err := executeConfigCommand("config", "unset")
if err == nil {
t.Error("Expected command to fail with no arguments")
}
// Test with too many arguments
_, err = executeConfigCommand("config", "unset", "key", "extra")
if err == nil {
t.Error("Expected command to fail with too many arguments")
}
}
func TestConfigReset(t *testing.T) {
_, _ = setupConfigTest(t)
// First set some custom values
cfg, err := config.Load()
if err != nil {
t.Fatalf("Failed to load config: %v", err)
}
cfg.Set("project_id", "custom-project")
cfg.Set("service_id", "custom-service")
cfg.Set("output", "json")
cfg.Set("analytics", "false")
// Execute reset command
output, err := executeConfigCommand("config", "reset")
if err != nil {
t.Fatalf("Command failed: %v", err)
}
if !strings.Contains(output, "Configuration reset to defaults") {
t.Errorf("Expected output to contain reset message, got '%s'", strings.TrimSpace(output))
}
cfg, err = config.Load()
if err != nil {
t.Fatalf("Failed to load config: %v", err)
}
// ProjectID should be preserved
if cfg.ProjectID != "custom-project" {
t.Errorf("Expected ProjectID %s, got %s", "custom-project", cfg.ProjectID)
}
// Verify all other values were reset to defaults
if cfg.APIURL != config.DefaultAPIURL {
t.Errorf("Expected default APIURL %s, got %s", config.DefaultAPIURL, cfg.APIURL)
}
if cfg.ServiceID != "" {
t.Errorf("Expected empty ServiceID, got %s", cfg.ServiceID)
}
if cfg.Output != config.DefaultOutput {
t.Errorf("Expected default Output %s, got %s", config.DefaultOutput, cfg.Output)
}
if cfg.Analytics != config.DefaultAnalytics {
t.Errorf("Expected default Analytics %t, got %t", config.DefaultAnalytics, cfg.Analytics)
}
}
func TestValueOrEmpty(t *testing.T) {
tests := []struct {
input string
expected string
}{
{"", "(not set)"},
{"value", "value"},
{"test-string", "test-string"},
}
for _, tt := range tests {
t.Run(tt.input, func(t *testing.T) {
result := valueOrEmpty(tt.input)
if result != tt.expected {
t.Errorf("valueOrEmpty(%q) = %q, expected %q", tt.input, result, tt.expected)
}
})
}
}
func TestConfigCommands_Integration(t *testing.T) {
_, _ = setupConfigTest(t)
// Test full workflow: set -> show -> unset -> reset
// 1. Set some values
_, err := executeConfigCommand("config", "set", "project_id", "integration-test")
if err != nil {
t.Fatalf("Failed to set project_id: %v", err)
}
_, err = executeConfigCommand("config", "set", "output", "json")
if err != nil {
t.Fatalf("Failed to set output: %v", err)
}
// 2. Show config in JSON format (should use the output format we just set)
showOutput, err := executeConfigCommand("config", "show")
if err != nil {
t.Fatalf("Failed to show config: %v", err)
}
// Should be JSON output
var result map[string]interface{}
if err := json.Unmarshal([]byte(showOutput), &result); err != nil {
t.Fatalf("Expected JSON output, got: %s", showOutput)
}
if result["project_id"] != "integration-test" {
t.Errorf("Expected project_id 'integration-test', got %v", result["project_id"])
}
// 3. Unset project_id
_, err = executeConfigCommand("config", "unset", "project_id")
if err != nil {
t.Fatalf("Failed to unset project_id: %v", err)
}
// 4. Verify project_id was unset
showOutput, err = executeConfigCommand("config", "show")
if err != nil {
t.Fatalf("Failed to show config after unset: %v", err)
}
json.Unmarshal([]byte(showOutput), &result)
if result["project_id"] != "" {
t.Errorf("Expected empty project_id after unset, got %v", result["project_id"])
}
// 5. Reset all config
_, err = executeConfigCommand("config", "reset")
if err != nil {
t.Fatalf("Failed to reset config: %v", err)
}
// 6. Verify everything is back to defaults
cfg, err := config.Load()
if err != nil {
t.Fatalf("Failed to load config after reset: %v", err)
}
if cfg.Output != config.DefaultOutput {
t.Errorf("Expected output reset to default %s, got %s", config.DefaultOutput, cfg.Output)
}
}
func TestConfigSet_OutputDoesPersist(t *testing.T) {
tmpDir, _ := setupConfigTest(t)
// Start with default config (no output setting in file)
configFile := config.GetConfigFile(tmpDir)
// Execute config set to explicitly set output to json
_, err := executeConfigCommand("config", "set", "output", "json")
if err != nil {
t.Fatalf("Failed to set output to json: %v", err)
}
// Read the config file directly
configBytes, err := os.ReadFile(configFile)
if err != nil {
t.Fatalf("Failed to read config file: %v", err)
}
// Parse the YAML to check
var configMap map[string]interface{}
if err := yaml.Unmarshal(configBytes, &configMap); err != nil {
t.Fatalf("Failed to parse config YAML: %v", err)
}
if outputVal, exists := configMap["output"]; !exists || outputVal != "json" {
t.Errorf("Expected output in config file to be 'json', got: %v (exists: %v)", outputVal, exists)
}
// Also verify by loading config
cfg, err := config.Load()
if err != nil {
t.Fatalf("Failed to load config: %v", err)
}
if cfg.Output != "json" {
t.Errorf("Expected loaded config output to be 'json', got: %s", cfg.Output)
}
// Now test that setting it to a different value updates the file
_, err = executeConfigCommand("config", "set", "output", "yaml")
if err != nil {
t.Fatalf("Failed to set output to yaml: %v", err)
}
// Read the config file again
configBytes, err = os.ReadFile(configFile)
if err != nil {
t.Fatalf("Failed to read config file after second set: %v", err)
}
configContent := string(configBytes)
// Verify that output was updated in the config file
if !strings.Contains(configContent, "output: yaml") {
t.Errorf("Config file should contain 'output: yaml' after update. Config content:\n%s", configContent)
}
// Should NOT contain the old value
if strings.Contains(configContent, "output: json") {
t.Errorf("Config file should NOT contain old 'output: json' value. Config content:\n%s", configContent)
}
}