From 156fe5891d0198774f46633338ed805147884c8d Mon Sep 17 00:00:00 2001 From: Georg Wicke Date: Mon, 8 Jun 2020 14:08:15 +0200 Subject: [PATCH 1/6] Better message when no tests are found --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 67a48a9..3946c8b 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "viewsWelcome": [ { "view": "dotnetTestExplorer", - "contents": "No tests found. \n\nPlease open or set the test project and ensure your project compiles." + "contents": "No tests found. \n\nPlease open the test project and ensure your project compiles. If the directory to execute dotnet test in is not the workspace root, consider setting dotnet-test-explorer.testProjectPath appropriately.\n[Open settings](command:workbench.action.openSettings?%5B%22dotnet-test-explorer.testProjectPath%22%5D)" } ], "views": { @@ -185,7 +185,7 @@ }, "dotnet-test-explorer.testProjectPath": { "type": "string", - "default": "", + "default": "{*.sln,**/*Test.@(cs|fs)proj,**/*Tests.@(cs|fs)proj}", "description": "Glob pattern that points to path of .NET Core test project(s)." }, "dotnet-test-explorer.treeMode": { From 958a221d815c50aabac5f264657d55778ced7fe7 Mon Sep 17 00:00:00 2001 From: Georg Wicke Date: Mon, 8 Jun 2020 14:08:35 +0200 Subject: [PATCH 2/6] Re-glob when pressing refresh --- src/extension.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/extension.ts b/src/extension.ts index e3b39ea..db058d5 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -78,6 +78,7 @@ export function activate(context: vscode.ExtensionContext) { })); context.subscriptions.push(vscode.commands.registerCommand("dotnet-test-explorer.refreshTestExplorer", () => { + testDirectories.parseTestDirectories(); dotnetTestExplorer.refreshTestExplorer(); })); From f0ad32beb16fde3381a14c1a6aaa9edd279649f6 Mon Sep 17 00:00:00 2001 From: Georg Wicke Date: Mon, 8 Jun 2020 14:24:27 +0200 Subject: [PATCH 3/6] Add testProjectPath examples --- package.json | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 3946c8b..3a164b6 100644 --- a/package.json +++ b/package.json @@ -185,8 +185,13 @@ }, "dotnet-test-explorer.testProjectPath": { "type": "string", - "default": "{*.sln,**/*Test.@(cs|fs)proj,**/*Tests.@(cs|fs)proj}", - "description": "Glob pattern that points to path of .NET Core test project(s)." + "default": "", + "description": "Glob pattern that points to path of .NET Core test project(s).", + "examples": [ + "**/*Test.@(csproj|vbproj|fsproj)", + "**/*Tests.@(csproj|vbproj|fsproj)", + "**/*.sln" + ] }, "dotnet-test-explorer.treeMode": { "type": "string", From 50ba2ec789eade68dda1efd31025f773023f73e2 Mon Sep 17 00:00:00 2001 From: Georg Wicke Date: Mon, 8 Jun 2020 14:24:43 +0200 Subject: [PATCH 4/6] Add newline --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3a164b6..0d6d3be 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "viewsWelcome": [ { "view": "dotnetTestExplorer", - "contents": "No tests found. \n\nPlease open the test project and ensure your project compiles. If the directory to execute dotnet test in is not the workspace root, consider setting dotnet-test-explorer.testProjectPath appropriately.\n[Open settings](command:workbench.action.openSettings?%5B%22dotnet-test-explorer.testProjectPath%22%5D)" + "contents": "No tests found. \n\nPlease open the test project and ensure your project compiles.\nIf the directory to execute dotnet test in is not the workspace root, consider setting dotnet-test-explorer.testProjectPath appropriately.\n[Open settings](command:workbench.action.openSettings?%5B%22dotnet-test-explorer.testProjectPath%22%5D)" } ], "views": { From 4e3e0425dba26ba302893dae40446543d60da301 Mon Sep 17 00:00:00 2001 From: Georg Wicke Date: Mon, 8 Jun 2020 14:31:02 +0200 Subject: [PATCH 5/6] Give terminal a more distinct name --- src/executor.ts | 2 +- src/logger.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/executor.ts b/src/executor.ts index 0960d43..7b67d4e 100644 --- a/src/executor.ts +++ b/src/executor.ts @@ -7,7 +7,7 @@ import { Logger } from "./logger"; export class Executor { - public static runInTerminal(command: string, cwd?: string, addNewLine: boolean = true, terminal: string = "Test Explorer"): void { + public static runInTerminal(command: string, cwd?: string, addNewLine: boolean = true, terminal: string = ".NET Test Explorer"): void { if (this.terminals[terminal] === undefined) { this.terminals[terminal] = vscode.window.createTerminal(terminal); } diff --git a/src/logger.ts b/src/logger.ts index 1928d28..d0ba00b 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -24,7 +24,7 @@ export class Logger { } } - private static defaultOutput = "Test Explorer"; + private static defaultOutput = ".NET Test Explorer"; private static outputTerminals: { [id: string]: vscode.OutputChannel } = {}; From 5bf5d132b3be7ab6c3415b02b800edd63cb10d7d Mon Sep 17 00:00:00 2001 From: Georg Wicke Date: Mon, 8 Jun 2020 14:56:28 +0200 Subject: [PATCH 6/6] Link should open workspace JSON settings --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0d6d3be..7e80dd0 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "viewsWelcome": [ { "view": "dotnetTestExplorer", - "contents": "No tests found. \n\nPlease open the test project and ensure your project compiles.\nIf the directory to execute dotnet test in is not the workspace root, consider setting dotnet-test-explorer.testProjectPath appropriately.\n[Open settings](command:workbench.action.openSettings?%5B%22dotnet-test-explorer.testProjectPath%22%5D)" + "contents": "No tests found. \n\nPlease open the test project and ensure your project compiles.\nIf the directory to execute dotnet test in is not the workspace root, consider setting dotnet-test-explorer.testProjectPath appropriately.\n[Open settings](command:workbench.action.openWorkspaceSettingsFile)" } ], "views": {