test: extend file watcher indexing tests#54
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 00c23206f9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| function isTrackedSourcePath(filePath: string): boolean { | ||
| const extension = path.extname(filePath).toLowerCase(); | ||
| return extension.length > 0 && TRACKED_EXTENSIONS.has(extension); |
There was a problem hiding this comment.
Reindex on extensionless metadata changes
The new extension filter returns early for any path without an extension, which means edits to files like .gitignore never trigger auto-refresh. CodebaseIndexer.scanFiles applies .gitignore when building the indexed file set, so changing ignore rules can add/remove indexed files, but with this gate the index remains stale until an unrelated tracked source edit (or manual refresh) occurs.
Useful? React with 👍 / 👎.
| const content = await readIndexedContent(tempDir); | ||
| return content.includes('UPDATED_TOKEN'); |
There was a problem hiding this comment.
Retry transient index reads during E2E polling
The polling callback reads and parses the keyword index on each iteration, but it does not handle transient read/parse failures while incremental indexing rewrites that file. In those moments readIndexedContent can throw (e.g., temporary ENOENT or partial JSON), and waitFor exits immediately instead of retrying, making this test flaky under slower I/O timing.
Useful? React with 👍 / 👎.
Greptile SummaryThis PR completes phase 2d validation by adding extension filtering to the file watcher and comprehensive E2E test coverage for auto-refresh functionality. Key Changes:
Testing: Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| src/core/file-watcher.ts | Added extension filtering to only track changes to supported source file types |
| tests/auto-refresh-e2e.test.ts | New E2E test validating automatic index updates when source files are edited |
| tests/file-watcher.test.ts | Added test case verifying non-tracked file extensions are properly ignored by watcher |
Last reviewed commit: 00c2320
Summary
Validation