Commit 54198dc
authored
test(webhook/mutating): migrate tests to Ginkgo/Gomega (#5755)
* test(webhook/mutating): migrate tests to Ginkgo/Gomega
Signed-off-by: Harsh <harshmastic@gmail.com>
* fix(webhook/mutating): use GinkgoT().Setenv for env-var restoration
Address Copilot and Gemini review findings: replace manual
DeferCleanup(os.Unsetenv) with GinkgoT().Setenv() which automatically
saves and restores the prior environment variable value after the spec.
Signed-off-by: Harsh <harshmastic@gmail.com>
* test(webhook/mutating): add webhook_test.go for HandlerMap coverage
Signed-off-by: Harsh <harshmastic@gmail.com>
* fix(webhook/mutating): remove brittle HaveLen assertion from HandlerMap test
Signed-off-by: Harsh <harshmastic@gmail.com>
* fix(webhook/mutating): assert handler is non-nil before type check
Signed-off-by: Harsh <harshmastic@gmail.com>
---------
Signed-off-by: Harsh <harshmastic@gmail.com>1 parent d6e3cc5 commit 54198dc
3 files changed
Lines changed: 54 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
| |||
1465 | 1464 | | |
1466 | 1465 | | |
1467 | 1466 | | |
1468 | | - | |
1469 | 1467 | | |
1470 | 1468 | | |
1471 | 1469 | | |
| |||
1474 | 1472 | | |
1475 | 1473 | | |
1476 | 1474 | | |
1477 | | - | |
1478 | | - | |
1479 | | - | |
1480 | | - | |
1481 | | - | |
1482 | | - | |
1483 | 1475 | | |
1484 | | - | |
1485 | | - | |
1486 | | - | |
1487 | | - | |
1488 | | - | |
1489 | | - | |
| 1476 | + | |
1490 | 1477 | | |
1491 | 1478 | | |
1492 | 1479 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
2 | 18 | | |
3 | 19 | | |
4 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
0 commit comments