Skip to content

Watch for changes in directory structure#846

Merged
aeisenberg merged 2 commits intogithub:mainfrom
aeisenberg:aeisenberg/test-dir-watcher
Apr 23, 2021
Merged

Watch for changes in directory structure#846
aeisenberg merged 2 commits intogithub:mainfrom
aeisenberg:aeisenberg/test-dir-watcher

Conversation

@aeisenberg
Copy link
Copy Markdown
Contributor

@aeisenberg aeisenberg commented Apr 23, 2021

This ensures that directories renamed, added or deleted are
properly checked to see if they contain tests. The test tree
will be correctly updated when any directory changes.s

Fixes #799.

Checklist

  • CHANGELOG.md has been updated to incorporate all user visible changes made by this pull request.
  • Issues have been created for any UI or other user-facing changes made by this pull request.
  • [n/a] @github/docs-content-codeql has been cc'd in all issues for UI or other user-facing changes made by this pull request.

This ensures that directories renamed, added or deleted are
properly checked to see if they contain tests. The test tree
will be correctly updated when any directory changes.s
// Watch for changes to any `.ql` or `.qlref` file in any of the QL packs that contain tests.
this.watcher.addWatch(new RelativePattern(results.watchPath, '**/*.{ql,qlref}'));
// need to explicitly watch for changes to directories themselves.
this.watcher.addWatch(new RelativePattern(results.watchPath, '**/'));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is all directories under a workspace folder? Any noticeable hit to performance on a large repo? Do we need to exclude database source archives?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing noticeable. I renamed the ql folder that is a submodule in the starter repo and there was no noticeable lag in the file explorer. The test explorer itself took a few seconds to update, but I think that's fair because it needs to re-discover the entire tree.

We don't need to do any special handling for source archives since they are readonly and aren't watched for changes.

@aeisenberg aeisenberg merged commit fce9bbc into github:main Apr 23, 2021
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.

Test Explorer consistently does not detect certain file actions

2 participants