Commit 801fac0
test(iris): local K8s e2e with auto-provisioned kind cluster (#3097)
## Summary
- Add `k8s_cluster` (session-scoped) and `k8s_runtime` (per-test)
fixtures to `conftest.py` — reusable by any e2e test
- `k8s_cluster` auto-creates a kind cluster if no K8s cluster is
reachable, tears it down after the session
- `k8s_runtime` creates an ephemeral namespace per test for isolation
- Add `test_kubernetes_runtime_lifecycle` — validates the full
`KubernetesRuntime` lifecycle (create pod, run, succeed, read logs)
against real K8s
- Marked `slow` + `e2e` so default CI is unaffected
- Update `TESTING.md` with the run command
### Motivation
Relates to #2944, #3062.
The CW canary ferry is unreliable for validating K8s runtime behavior
(RBAC issues, Connection refused — see #3091). This test validates
`KubernetesRuntime` against any local cluster in seconds.
### How to use
```bash
# Just run it — kind cluster is auto-created if needed (requires: brew install kind)
uv run pytest lib/iris/tests/e2e/test_coreweave_live_kubernetes_runtime.py \
-m slow -k kubernetes -v -o "addopts="
# Or bring your own cluster (kind, k3d, minikube, remote)
kind create cluster --name iris-test
uv run pytest lib/iris/tests/e2e/test_coreweave_live_kubernetes_runtime.py \
-m slow -k kubernetes -v -o "addopts="
```
## Test plan
- [x] Test passes with auto-created kind cluster (~49s including cluster
create/teardown)
- [x] Test passes with pre-existing kind cluster (~14s)
- [x] Default `uv run pytest` skips the test (marked `slow`)
- [x] Fixture auto-skips when no cluster reachable and kind not
installed
- [x] Pre-commit passes
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 80c97eb commit 801fac0
File tree
3 files changed
+111
-5
lines changed- lib/iris
- tests/e2e
3 files changed
+111
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
164 | 168 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
| 19 | + | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
| 25 | + | |
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
| |||
420 | 424 | | |
421 | 425 | | |
422 | 426 | | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
Lines changed: 23 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
162 | 161 | | |
163 | 162 | | |
164 | 163 | | |
165 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
166 | 187 | | |
167 | 188 | | |
168 | 189 | | |
| |||
225 | 246 | | |
226 | 247 | | |
227 | 248 | | |
228 | | - | |
229 | 249 | | |
230 | 250 | | |
231 | 251 | | |
| |||
286 | 306 | | |
287 | 307 | | |
288 | 308 | | |
289 | | - | |
290 | 309 | | |
291 | 310 | | |
292 | 311 | | |
| |||
327 | 346 | | |
328 | 347 | | |
329 | 348 | | |
330 | | - | |
331 | 349 | | |
332 | 350 | | |
333 | 351 | | |
| |||
0 commit comments