(t *testing.T, path string, v value)
| 93 | } |
| 94 | |
| 95 | func writeValueToFile(t *testing.T, path string, v value) { |
| 96 | t.Helper() |
| 97 | buf, err := yaml.Marshal(v) |
| 98 | require.NoError(t, err) |
| 99 | require.NoError(t, os.WriteFile(path+".tmp", buf, 0777)) |
| 100 | // Atomically replace file with new file, so that manager cannot see unfinished modification. |
| 101 | require.NoError(t, os.Rename(path+".tmp", path)) |
| 102 | } |
| 103 | |
| 104 | func newTestOverridesManagerConfig(t *testing.T, reloadPeriod time.Duration, loader func(reader io.Reader) (interface{}, error)) Config { |
| 105 | // create empty file |
no test coverage detected