Claude Code hooks (3/4): test runner#7242
Open
edmundmiller wants to merge 1 commit into
Open
Conversation
After editing a .groovy/.java file under modules/ or plugins/, map it to its test class and run it via gradle (e.g. CacheDB.groovy -> ":nextflow:test --tests *CacheDBTest"); test files run themselves. On failure, block and feed the failure summary back to Claude, falling back to the tail of the output when no failure lines match. Written in Bash; parses the payload with jq. Wired as a PostToolUse hook because it keys off tool_input.file_path, which is only present on Edit/Write/MultiEdit events. Scoping lives in the script (covers all three edit tools and both extensions with no gaps), so no declarative `if` is used here. Stacked on hooks-2-build-check. Signed-off-by: Edmund Miller <edmund.miller@seqera.io>
098629c to
8eef39e
Compare
0936cb9 to
578641e
Compare
This was referenced Jun 18, 2026
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.
Part 3 of the Claude Code engine-development hooks stack. Targets
hooks-2-build-check(PR #7241).
This PR — Test runner (PostToolUse)
hooks/run-tests.sh: after editing a.groovy/.javafile undermodules/orplugins/,map it to its test class and run it via gradle — e.g.
modules/nextflow/.../cache/CacheDB.groovy→./gradlew :nextflow:test --tests "*CacheDBTest"(test files run themselves).
tool_input.file_path, which is onlypresent on
Edit/Write/MultiEditevents.test runs are too heavy.
Stack
🤖 Generated with Claude Code