Skip to content

fix(affected): recognize root-level test files#1273

Open
Jseca666 wants to merge 1 commit into
colbymchenry:mainfrom
Jseca666:codex/fix-affected-root-tests
Open

fix(affected): recognize root-level test files#1273
Jseca666 wants to merge 1 commit into
colbymchenry:mainfrom
Jseca666:codex/fix-affected-root-tests

Conversation

@Jseca666

Copy link
Copy Markdown

Summary

  • reuse the shared isTestFile() classifier in codegraph affected
  • recognize root-level pytest files such as tests/test_example.py
  • use the existing picomatch dependency for custom --filter globs

Root cause

The affected command maintained a second, narrower set of test-file patterns instead of using the shared classifier. A dependent file such as tests/test_cli.py was present in the graph and traversed, but it was not classified as a test because the CLI-only directory regex required a leading slash and did not recognize Python's test_*.py naming convention.

The hand-written glob conversion also translated ** into one-or-more path characters, so tests/**/*.py failed to match a test directly under tests/.

Verification

  • npm run build
  • npm test -- __tests__/is-test-file.test.ts __tests__/cli-affected-paths.test.ts
  • 8 related tests pass, including end-to-end coverage for root-level pytest files and zero-directory globstar matching

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.

1 participant