(t *testing.T)
| 262 | } |
| 263 | |
| 264 | func TestStartFailsWhenConfigMissing(t *testing.T) { |
| 265 | tmpDir := t.TempDir() |
| 266 | authDir := filepath.Join(tmpDir, "auth") |
| 267 | if err := os.MkdirAll(authDir, 0o755); err != nil { |
| 268 | t.Fatalf("failed to create auth dir: %v", err) |
| 269 | } |
| 270 | configPath := filepath.Join(tmpDir, "missing-config.yaml") |
| 271 | |
| 272 | w, err := NewWatcher(configPath, authDir, nil) |
| 273 | if err != nil { |
| 274 | t.Fatalf("failed to create watcher: %v", err) |
| 275 | } |
| 276 | defer w.Stop() |
| 277 | |
| 278 | ctx, cancel := context.WithCancel(context.Background()) |
| 279 | defer cancel() |
| 280 | |
| 281 | if err := w.Start(ctx); err == nil { |
| 282 | t.Fatal("expected Start to fail for missing config file") |
| 283 | } |
| 284 | } |
| 285 | |
| 286 | func TestDispatchRuntimeAuthUpdateEnqueuesAndUpdatesState(t *testing.T) { |
| 287 | queue := make(chan AuthUpdate, 4) |
nothing calls this directly
no test coverage detected