Skip to content
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

Fix for some bugs #16906

Merged
merged 1 commit into from
Aug 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/2 Fixes/16855.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix for test welcome screen flashes on refresh.
1 change: 1 addition & 0 deletions news/2 Fixes/16902.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix for unittest not getting discovered in all cases.
8 changes: 5 additions & 3 deletions src/client/testing/testController/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ export class PythonTestController implements ITestController {
if (uri === undefined) {
// This is a special case where we want everything to be re-discovered.
traceVerbose('Testing: Clearing all discovered tests');
const ids: string[] = [];
this.testController.items.forEach((i) => ids.push(i.id));
ids.forEach((id) => this.testController.items.delete(id));
this.testController.items.forEach((item) => {
const ids: string[] = [];
item.children.forEach((child) => ids.push(child.id));
ids.forEach((id) => item.children.delete(id));
});

traceVerbose('Testing: Forcing test data refresh');
return this.refreshTestDataInternal(undefined);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,9 @@ function testDiscoveryParser(

const folderParts = [];
for (const folder of folders) {
const parentId = folderParts.length === 0 ? testDir : `${folderParts.join('/')}`;
const parentId = folderParts.length === 0 ? testDir : `./${folderParts.join('/')}`;
folderParts.push(folder);
const pathId = `${folderParts.join('/')}`;
const pathId = `./${folderParts.join('/')}`;
const rawFolder = parents.find((f) => f.id === pathId);
if (!rawFolder) {
parents.push({
Expand Down