From 21902d5918eeeb7b099f53ec91f03830a7b4c6f5 Mon Sep 17 00:00:00 2001 From: Greg Leeper Date: Thu, 1 Feb 2024 20:17:45 -0500 Subject: [PATCH 1/3] Add args.background to go.test TestConfig objects --- extension/src/goTest.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extension/src/goTest.ts b/extension/src/goTest.ts index 5d089bc02c..6ced43e914 100644 --- a/extension/src/goTest.ts +++ b/extension/src/goTest.ts @@ -219,6 +219,7 @@ async function runTestAtCursor( functions: testConfigFns, isBenchmark: cmd === 'benchmark', isMod, + background: !!args?.background, applyCodeCoverage: goConfig.get('coverOnSingleTest') }; // Remember this config as the last executed test. @@ -319,6 +320,7 @@ export function testCurrentPackage(isBenchmark: boolean): CommandFactory { flags: getTestFlags(goConfig, args), isBenchmark, isMod, + background: !!args?.background, applyCodeCoverage: goConfig.get('coverOnTestPackage') }; // Remember this config as the last executed test. @@ -350,6 +352,7 @@ export const testWorkspace: CommandFactory = () => (args: any) => { goConfig, dir: workspaceUri.fsPath, flags: getTestFlags(goConfig, args), + background: !!args?.background, includeSubDirectories: true }; // Remember this config as the last executed test. @@ -396,6 +399,7 @@ export function testCurrentFile(isBenchmark: boolean, getConfig = getGoConfig): functions: testFunctions?.map((sym) => sym.name), isBenchmark, isMod, + background: !!args?.background, applyCodeCoverage: goConfig.get('coverOnSingleTestFile') }; // Remember this config as the last executed test. From 51972b93f7c9963463e7db395e936675470df34f Mon Sep 17 00:00:00 2001 From: Greg Leeper Date: Thu, 1 Feb 2024 20:17:45 -0500 Subject: [PATCH 2/3] Add args.background to go.test TestConfig objects --- extension/src/goTest.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extension/src/goTest.ts b/extension/src/goTest.ts index 5d089bc02c..dc4503ebe3 100644 --- a/extension/src/goTest.ts +++ b/extension/src/goTest.ts @@ -219,6 +219,7 @@ async function runTestAtCursor( functions: testConfigFns, isBenchmark: cmd === 'benchmark', isMod, + background: !!args?.background, applyCodeCoverage: goConfig.get('coverOnSingleTest') }; // Remember this config as the last executed test. @@ -319,6 +320,7 @@ export function testCurrentPackage(isBenchmark: boolean): CommandFactory { flags: getTestFlags(goConfig, args), isBenchmark, isMod, + background: !!args?.background, applyCodeCoverage: goConfig.get('coverOnTestPackage') }; // Remember this config as the last executed test. @@ -349,6 +351,7 @@ export const testWorkspace: CommandFactory = () => (args: any) => { const testConfig: TestConfig = { goConfig, dir: workspaceUri.fsPath, + background: !!args?.background, flags: getTestFlags(goConfig, args), includeSubDirectories: true }; @@ -396,6 +399,7 @@ export function testCurrentFile(isBenchmark: boolean, getConfig = getGoConfig): functions: testFunctions?.map((sym) => sym.name), isBenchmark, isMod, + background: !!args?.background, applyCodeCoverage: goConfig.get('coverOnSingleTestFile') }; // Remember this config as the last executed test. From aeebba92a5aefa6e6e8ff50b0e90d5c95c7abf00 Mon Sep 17 00:00:00 2001 From: Greg Leeper Date: Wed, 28 Feb 2024 18:49:38 -0500 Subject: [PATCH 3/3] remove duplicate background --- extension/src/goTest.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/extension/src/goTest.ts b/extension/src/goTest.ts index b7f5523887..dc4503ebe3 100644 --- a/extension/src/goTest.ts +++ b/extension/src/goTest.ts @@ -353,7 +353,6 @@ export const testWorkspace: CommandFactory = () => (args: any) => { dir: workspaceUri.fsPath, background: !!args?.background, flags: getTestFlags(goConfig, args), - background: !!args?.background, includeSubDirectories: true }; // Remember this config as the last executed test.