-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restructure the tree in the Test Explorer View #624
Restructure the tree in the Test Explorer View #624
Conversation
@@ -98,12 +110,12 @@ interface QLTestDiscoveryResults { | |||
/** | |||
* The root test directory for each QL pack that contains tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update comment please :)
@@ -98,12 +110,12 @@ interface QLTestDiscoveryResults { | |||
/** | |||
* The root test directory for each QL pack that contains tests. | |||
*/ | |||
testDirectories: QLTestDirectory[]; | |||
testDirectory: QLTestDirectory | undefined; | |||
/** | |||
* The list of file system paths to watch. If any of these paths changes, the discovery results |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update comment please :)
public get onDidChangeTests(): Event<void> { return this._onDidChangeTests.event; } | ||
public get onDidChangeTests(): Event<void> { | ||
return this._onDidChangeTests.event; | ||
} | ||
|
||
/** | ||
* The root test directory for each QL pack that contains tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update - I assume this is just the workspace folder, viewed as a QLTestDirectory
.
|
||
return { testDirectories, watchPaths }; | ||
return { | ||
testDirectory: await this.discoverTests(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We now unconditionally run test discovery on all workspace folders. How does this scale/perform when we have a large workspace with many folders, or a single large repo (like our internal codebase)? Does it also attempt to search the source archives that we add to the workspace in the extension, and if so can we skip them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll try this out on different repos to see.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh...never submitted these comments from days ago.
|
||
return { testDirectories, watchPaths }; | ||
return { | ||
testDirectory: await this.discoverTests(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll try this out on different repos to see.
Some outstanding doc comments, and changelog conflicts. |
With this change we display the tree based on the file system not based on ql-packs. We also merge test folders whose only child is another test folder. Resolves github#595
ea3db03
to
5cc9f83
Compare
Update here. I found a bug in how discovery works. QLTest discovery runs twice at startup. The reason is this:
This is the case with the Now the bad news. Each initial discovery operation in the new way (from the root of the workspace folder takes between 500-1500ms. Under the current way, where we do discovery from the roots of the test qlpacks, initial discovery takes between 100-200ms. For whatever reason, subsequent discoveries under the new way are quicker (700-800ms) and slower under the old way (400-500ms). This data was not captured very scientifically. I personally think that this difference in time is not a deal breaker. Initial discovery being slow is less important since that happens during other initialization so, a little slowness for tests is not very noticeable. And the fact that it takes about 2x longer for subsequent discoveries is not noticeable either since this happens during a save, while editing. With this in mind, I will refactor to remove the double discovery operations. This will mean that qlpack discovery will be removed. |
We no longer rely on qlpacks for our ql test structure. For this reason, we no longer need to do qlpack discovery.
0e9e2a9
to
a7a582d
Compare
Ping! @github/docs-content-dsp This PR changes the layout structure of the QL test tree. Before this PR, the test tree was scoped by workspace folders, then by ql packs in those folders. The new layout that the ql test tree matches the filesystem. This makes it easier to map tests back to their location in the filesystem. |
📚 EDIT: No docs impact ✔️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ping! @github/docs-content-dsp This PR changes the layout structure of the QL test tree. Before this PR, the test tree was scoped by workspace folders, then by ql packs in those folders.
The new layout that the ql test tree matches the filesystem. This makes it easier to map tests back to their location in the filesystem.
Thanks, makes sense! We don't go into detail about the structure of the Test Explorer view in the docs, so this doesn't need explicit documentation 😃
@@ -28,6 +28,7 @@ | |||
- Add a `View DIL` command on query history items. This opens a text editor containing the Datalog Intermediary Language representation of the compiled query. | |||
- Remove feature flag for the AST Viewer. For more information on how to use the AST Viewer, [see the documentation](https://help.semmle.com/codeql/codeql-for-vscode/procedures/exploring-the-structure-of-your-source-code.html). | |||
- The `codeQL.runningTests.numberOfThreads` setting is now used correctly when running tests. | |||
- Alter structure of the _Test Explorer_ tree. It now follows the structure of the filesystem instead of the qlpacks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Alter structure of the _Test Explorer_ tree. It now follows the structure of the filesystem instead of the qlpacks. | |
- Alter structure of the _Test Explorer_ tree. It now follows the structure of the filesystem instead of the QL packs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops I think this suggestion got omitted.
With this change we display the tree based on the file system not based
on ql-packs. We also merge test folders whose only child is another
test folder.
Resolves #595
Checklist
@github/docs-content-dsp
has been cc'd in all issues for UI or other user-facing changes made by this pull request.