bugfix - preserve per-file inline test module context (#676)#678
Merged
dannymeijer merged 1 commit intoMay 24, 2026
Merged
Conversation
577e8c8 to
353602a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes directory-level
incan testruns for multiple source files that each define one inlinemodule tests:block. The runner now keeps each inline source file as its own generated Rust module, with the generated#[test]harness injected beside that file's declarations. That preserves both parser cardinality and file-local import scope while still batching through one Cargo/libtest harness where the files are compatible. It also bumps the release train to0.3.0-rc14and records #676 in the 0.3 release notes.Type of change
docs/RFCs/*)Area(s)
Select the primary areas touched (used for review routing; labels are managed separately):
Key details
incan test srccan now run inline tests from multiple non-test.incnsource files without reportingOnly one module tests block is allowed per fileacross the whole directory batch and without Rust E0255 collisions when one inline-tested file imports a public item from another.from functions.columns import colcollision shape.Testing / verification
make test/cargo testmake examples(if relevant)incan fmt --check .(if relevant)Manual verification notes:
E0255: the name col is defined multiple times.cargo run --quiet --features cli --bin incan -- test <minimal-repro>/src/functionspassed with the InQL-style import/public-name collision shape.cargo test -p incan --test integration_tests e2e_directory_run_preserves_per_file_inline_test_modules_issue676 -- --nocapturepassed.cargo test -p incan --test integration_tests e2e_inline_and_imported_surfaces_share_one_project -- --nocapturepassed.cargo test -p incan cli::test_runner::execution::tests --quietpassed.cargo fmt --checkpassed.git diff --checkpassed.make pre-commitpassed.Docs impact
If docs updated:
workspaces/docs-site/docs/release_notes/0_3.mdChecklist
Closes #676