kubernetes/test
Patrick Ohly 047682908d ktesting: replace Begin/End with TContext.Step
Manually pairing Being with End is too error prone to be useful. It had the
advantage of keeping variables created between them visible to the following
code, but that doesn't justify using those calls.

By using a callback we can achieve a few things:

- Code using it automatically shadows the parent tCtx, thus enforcing
  that within a code block the tCtx with step is used consistently.
- The code block is clearly delineated with curly braces.
- When the code block ends, the unmodified parent tCtx is automatically
  in scope again.

Downsides:

- Extra boilerplate for the anonymous function.
  Python's `with tCtx.Step(...) as tCtx: ` would be nicer.
  As an approximation of that `for tCtx := range tCtx.Step(...)` was
  tried with `Step` returning an iterator, but that wasn't very idiomatic.
- Variables created inside the code block are not visible outside of it.
2026-01-07 14:11:33 +01:00
..
cmd Add client-go credential plugin to kuberc 2025-11-09 14:24:53 -05:00
compatibility_lifecycle Disable SchedulerAsyncAPICalls in v1.35 due to performance issues 2025-12-23 12:34:47 +00:00
conformance hack/update-conformance-yaml.sh 2025-11-05 14:27:15 -08:00
e2e DRA e2e: make driver deployment possible in Go unit tests 2026-01-07 14:11:33 +01:00
e2e_dra ktesting: replace Begin/End with TContext.Step 2026-01-07 14:11:33 +01:00
e2e_kubeadm switch to latest sigs.k8s.io/yaml v1.5.0 (run update-gofmt.sh as well) 2025-06-25 11:42:12 -04:00
e2e_node build: remove deprecated '// +build' tag 2025-12-18 12:16:21 +01:00
fixtures React to removing autoscaling v2beta1 and v2beta2 2025-12-05 11:59:30 +01:00
fuzz switch to latest sigs.k8s.io/yaml v1.5.0 (run update-gofmt.sh as well) 2025-06-25 11:42:12 -04:00
images Merge pull request #134243 from lucming/lucming/enhan-stsfs-type 2025-12-20 15:48:31 -08:00
instrumentation Update instrumentation/documentation.md 2025-11-30 11:51:52 -08:00
integration ktesting: reimplement without interface 2026-01-05 13:45:03 +01:00
kubemark Update NPD to v1.34.0 2025-09-27 19:57:47 +03:00
list
soak/serve_hostnames
typecheck
utils ktesting: replace Begin/End with TContext.Step 2026-01-07 14:11:33 +01:00
OWNERS emeritus spiffxp 2025-06-10 20:05:40 -07:00