Repository navigation
fix(hooks): resolve Rust integration test targets inside tests subdirectories - #304
Merged
Merged
Conversation
…ectories Map a changed tests/<dir>/<file>.rs to the target that contains it, using Cargo.toml [[test]] name/path first, then Cargo auto-discovery, and fall back to the full suite when no target can be determined. Closes #303 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Match a declared [[test]] path exactly unless it lives in a subdirectory of tests/, prefer the most specific declaration, and fall back to the full suite when Cargo.toml cannot be read or parsed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
概要
検証 hook の
rust_planが,tests/<dir>/<file>.rsの変更に対してもcargo test --test <file>を実行し,存在しないテスト名で失敗していた.変更されたファイルを含む統合テストのターゲットを解決するようにした.Cargo.tomlの[[test]]にpathがあれば,そのファイルまたはディレクトリを含むエントリのnameを使う(tomllibで解析).tests/<name>.rs→<name>,tests/<dir>/main.rsがあれば<dir>).RUST_FULL_SUITE)にする.変更前後
tests/foo.rsを変更--test foo--test foo(変わらない)tests/<dir>/<file>.rsを変更--test <file>(存在せず失敗)[[test]]のname,なければ<dir>受け入れ条件
tests/<dir>/<file>.rsの変更で,そのファイルを含むテストが実行される[[test]]のnameとpathが考慮されるCloses #303
🤖 Generated with Claude Code