Skip to content

fix(cli): affected shares the tool's one notion of a test file - #1688

Open
danusha2345 wants to merge 1 commit into
colbymchenry:mainfrom
danusha2345:fix/1507-affected-test-conventions
Open

fix(cli): affected shares the tool's one notion of a test file#1688
danusha2345 wants to merge 1 commit into
colbymchenry:mainfrom
danusha2345:fix/1507-affected-test-conventions

Conversation

@danusha2345

Copy link
Copy Markdown
Contributor

Fixes #1507.

Problem

codegraph affected kept six regexes of its own — .test., .spec., /tests/, /__tests__/, /e2e/, /spec/ — so a Go foo_test.go, a Python test_foo.py or a JVM FooTest.kt beside the changed file was never reported, and "No test files affected" read as "no coverage", while search and the MCP tools counted those very files as tests.

Change

Drop the local list and use isTestPath from search/query-utils — the narrow "a suite that exercises other code" predicate, not the wide isTestFile that also covers examples and fixtures. --filter still overrides.

Verification

New __tests__/cli-affected-test-conventions.test.ts against the built binary: Go _test.go, Python test_*.py, Kotlin *Test.kt are reported; --filter still wins. Full suite green (221 files; the 16 skipped are the usual Windows/perf gates).

🤖 Generated with Claude Code

…mchenry#1507)

`codegraph affected` kept six regexes of its own — `.test.`, `.spec.`,
`/tests/`… — so a Go `foo_test.go`, a Python `test_foo.py` or a JVM
`FooTest.kt` beside the changed file was never reported, and "no tests
affected" read as "no coverage". Use isTestPath from search/query-utils,
the same predicate search and the MCP tools already rank by.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Go: codegraph affected never matches *_test.go — the CLI-local isTestFile duplicates and diverges from search/query-utils.ts

1 participant