(t *testing.T)
| 446 | } |
| 447 | |
| 448 | func TestExecHook_WaitOptionsPassedDownstream(t *testing.T) { |
| 449 | is := assert.New(t) |
| 450 | |
| 451 | failer := &kubefake.FailingKubeClient{ |
| 452 | PrintingKubeClient: kubefake.PrintingKubeClient{Out: io.Discard}, |
| 453 | } |
| 454 | |
| 455 | configuration := &Configuration{ |
| 456 | Releases: storage.Init(driver.NewMemory()), |
| 457 | KubeClient: failer, |
| 458 | Capabilities: common.DefaultCapabilities, |
| 459 | } |
| 460 | |
| 461 | rel := &release.Release{ |
| 462 | Name: "test-release", |
| 463 | Namespace: "test", |
| 464 | Hooks: []*release.Hook{ |
| 465 | { |
| 466 | Name: "test-hook", |
| 467 | Kind: "ConfigMap", |
| 468 | Path: "templates/hook.yaml", |
| 469 | Manifest: `apiVersion: v1 |
| 470 | kind: ConfigMap |
| 471 | metadata: |
| 472 | name: test-hook |
| 473 | namespace: test |
| 474 | data: |
| 475 | foo: bar |
| 476 | `, |
| 477 | Weight: 0, |
| 478 | Events: []release.HookEvent{ |
| 479 | release.HookPreInstall, |
| 480 | }, |
| 481 | }, |
| 482 | }, |
| 483 | } |
| 484 | |
| 485 | // Use WithWaitContext as a marker WaitOption that we can track |
| 486 | ctx := context.Background() |
| 487 | waitOptions := []kube.WaitOption{kube.WithWaitContext(ctx)} |
| 488 | |
| 489 | err := configuration.execHook(rel, release.HookPreInstall, kube.StatusWatcherStrategy, waitOptions, 600, false) |
| 490 | is.NoError(err) |
| 491 | |
| 492 | // Verify that WaitOptions were passed to GetWaiter |
| 493 | is.NotEmpty(failer.RecordedWaitOptions, "WaitOptions should be passed to GetWaiter") |
| 494 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…