(t *testing.T)
| 91 | } |
| 92 | |
| 93 | func createGlobalConfiguration(t *testing.T) { |
| 94 | filename := homeConfigurationFilename(".yml") |
| 95 | c, err := parseYAML(filename) |
| 96 | if err != nil { |
| 97 | // this error will be occurred the first time that the configuration |
| 98 | // file doesn't exist. |
| 99 | // Create the YAML-ONLY global configuration file now using the default configuration 'c'. |
| 100 | // This is useful when we run multiple iris servers that share the same |
| 101 | // configuration, even with custom values at its "Other" field. |
| 102 | out, err := yaml.Marshal(&c) |
| 103 | |
| 104 | if err == nil { |
| 105 | err = os.WriteFile(filename, out, os.FileMode(0666)) |
| 106 | } |
| 107 | if err != nil { |
| 108 | t.Fatalf("error while writing the global configuration field at: %s. Trace: %v\n", filename, err) |
| 109 | } |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | func TestConfigurationGlobal(t *testing.T) { |
| 114 | t.Cleanup(func() { |
no test coverage detected
searching dependent graphs…