fix(cli): resolve test imports from the project root - #2945
Conversation
I compile generated test harnesses in memory with the original test path and the invocation project root. This keeps package and file-relative imports aligned with hew run while preserving per-test process isolation. I add multi-file project and string-import regressions alongside the existing test-runner coverage.
|
CI is red because the new |
|
The red check is deterministic: |
Summary
hew testcompiled each harness from a staged copy in a temporary directory, so the compiler inferred that directory as the project root and no cross-file import resolved inside any test. Harnesses now compile in memory against the original test path with the project root threaded through, making test-time import resolution identical tohew run. A multi-file fixture and a string-path regression pin the behaviour.Verification
cargo test -p hew-cli --test test_runner_e2e: 30 passed, 0 failedcargo test -p hew-cli --bin hew test_runner: 27 passed, 0 failedOut of scope
*_test.hewpeers is handled separately and untouched here.