Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/docs/5-project/process
Repository files (latest commit first)
Filename Latest commit message Latest commit date
maia 0d6065cf8f vm-tests: the typecheck fails a step that rebinds a function of its script
A VM test script and `lib/k3s.py` share one namespace, so a step that assigns
`pod = ...` replaces the library's `pod()` for every later call and the test dies
mid-run with `TypeError: 'dict' object is not callable`. `ty` and
`ruff --select F` accept a module-level rebinding, so this cost a full VM round
on #6947.

`vm-test-shadow-scan.py` parses the script and fails when a name bound at module
level (assignment, `for` or `with` target, `import ... as`, walrus, `except ... as`)
is also a module-level `def`. It looks into `with`, `if`, `for`, `while` and `try`
bodies, where `with subtest(...)` steps live, and not into function or
comprehension bodies. Every `vm-test-typecheck-<name>` runs it on the script alone.
`vm-test-typecheck-shadow-control` passes only when it rejects each form of
rebinding and accepts the same names where they are local.

The one existing case, `sources` in `k8s-services`, is renamed `cred_sources`.

Closes #6951
2026-11-28 02:01:35 +01:00
..
ci-checks.md vm-tests: the typecheck fails a step that rebinds a function of its script 2026-11-28 02:01:35 +01:00
conventions.md run the metrics store and its auth responders as pods 2026-11-27 21:30:12 +01:00
gotchas.md run the metrics store and its auth responders as pods 2026-11-27 21:30:12 +01:00
pr-review-gate.md docs: sort the top-level directories into five sections by what the reader wants 2026-11-06 18:46:57 +01:00