Repository navigation
Split Cloud Hypervisor host executor tests by responsibility - #11546
Conversation
Co-authored-by: lpcox <[email protected]>
There was a problem hiding this comment.
🔵 Needs a closer look
The broad refactor spans shared fixtures, fake timers, lifecycle and cleanup paths, broker scenarios, and CI selectors, so runtime execution and human review are needed to confirm ordering, isolation, and behavioral parity.
No open issues 🎉
What changed in this PR
This PR refactors the Cloud Hypervisor host executor tests into focused suites without changing production code. Shared fixtures and scenario definitions reduce duplication while CI selectors and documentation are updated for the new test paths.
Changes:
- Split credential boundaries, staging/lifecycle behavior, artifact preflight, and result validation into separate test files.
- Extract scratch-directory, backend fixture, scenario, and timer setup into shared test utilities.
- Update CI test selectors, dotted filename parsing, and the bounded-output ADR reference.
| File | Description |
|---|---|
| src/cloud-hypervisor/host-enclave-executor.test.ts | Retains the two executor-factory tests at their original path and uses shared setup. |
| src/cloud-hypervisor/host-enclave-executor.test-utils.ts | Provides shared scenarios, scratch-directory helpers, backend fixtures, cleanup logic, and timer handling. |
| src/cloud-hypervisor/host-enclave-executor.staging.test.ts | Covers staging, deadlines, lifecycle, recovery, diagnostics, and cleanup scenarios. |
| src/cloud-hypervisor/host-enclave-executor.result-validation.test.ts | Covers bounded, canonical, schema-validated result handling. |
| src/cloud-hypervisor/host-enclave-executor.preflight.test.ts | Contains artifact verification, attestation, provenance, and trust tests. |
| src/cloud-hypervisor/host-enclave-executor.bounded-result.test.ts | Isolates credential and model-budget boundary tests. |
| scripts/ci/test-cloud-hypervisor-enclave-workflow.test.ts | Supports dotted test filenames and verifies the expanded selector list. |
| docs/adr/0002-cloud-hypervisor-enclave-executor.md | Points bounded-output documentation to the result-validation suite. |
| .github/workflows/test-cloud-hypervisor-enclaves.yml | Adds the focused suites to deterministic CI execution. |
Review effort: Lite (dynamic)
|
✅ Copilot review passed with no inline comments. @copilot Add the |
Documentation PreviewDocumentation has been built for this PR. To view locally:
Built from commit 09361f3 |
The 2,009-line executor suite mixed four responsibilities, with eight backend scenarios sharing a 1,236-line callback that obscured failures.
*.test-utils.ts; give recovery and cleanup scenarios independent test names.