From 100f534371758c9338f667e9745c0dc2467aa0a6 Mon Sep 17 00:00:00 2001 From: Jay Miller Date: Wed, 2 Feb 2022 08:53:07 -0700 Subject: [PATCH 1/4] Fixes #63: __dirname must be quoted to support paths with spaces. --- Extension/PesterTask/src/pester.ts | 2 +- Extension/PesterTask/src/pesterv10.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Extension/PesterTask/src/pester.ts b/Extension/PesterTask/src/pester.ts index 478b3a0..a09b597 100644 --- a/Extension/PesterTask/src/pester.ts +++ b/Extension/PesterTask/src/pester.ts @@ -45,7 +45,7 @@ export async function run() { } // we need to not pass the null param - var args = [__dirname + "\\Pester.ps1", + var args = ['"' + __dirname + "\\Pester.ps1" + '"', "-scriptFolder", scriptFolder, "-resultsFile", resultsFile, "-run32Bit", run32Bit, diff --git a/Extension/PesterTask/src/pesterv10.ts b/Extension/PesterTask/src/pesterv10.ts index 531fdb4..bcb259d 100644 --- a/Extension/PesterTask/src/pesterv10.ts +++ b/Extension/PesterTask/src/pesterv10.ts @@ -45,7 +45,7 @@ export async function run() { } // we need to not pass the null param - var args = [__dirname + "\\Pester.ps1", + var args = ['"' + __dirname + "\\Pester.ps1" + '"', "-TestFolder", TestFolder, "-resultsFile", resultsFile, "-run32Bit", run32Bit, From fba055005d4cd561852def0f6250086d87461510 Mon Sep 17 00:00:00 2001 From: Chris Gardner Date: Wed, 2 Feb 2022 19:44:19 +0000 Subject: [PATCH 2/4] Update validate step to use specific image Fails if no image is specified as ubuntu16 isn't a valid label (presumably a default somewhere in the background). --- azure-pipelines.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7120d82..a2643b5 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -81,6 +81,8 @@ stages: jobs: - deployment: validate displayName: Validate publish + pool: + vmImage: windows-latest environment: pester strategy: runOnce: From 74539a2aeb407288376990fb234a70e5ff9e8556 Mon Sep 17 00:00:00 2001 From: Chris Gardner Date: Wed, 2 Feb 2022 20:12:57 +0000 Subject: [PATCH 3/4] Swap to using forward slash as it works on all platforms while backslashes dont work on non-windows. --- Extension/PesterTask/src/pester.ts | 2 +- Extension/PesterTask/src/pesterv10.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Extension/PesterTask/src/pester.ts b/Extension/PesterTask/src/pester.ts index a09b597..2c0c837 100644 --- a/Extension/PesterTask/src/pester.ts +++ b/Extension/PesterTask/src/pester.ts @@ -45,7 +45,7 @@ export async function run() { } // we need to not pass the null param - var args = ['"' + __dirname + "\\Pester.ps1" + '"', + var args = ['"' + __dirname + "/Pester.ps1" + '"', "-scriptFolder", scriptFolder, "-resultsFile", resultsFile, "-run32Bit", run32Bit, diff --git a/Extension/PesterTask/src/pesterv10.ts b/Extension/PesterTask/src/pesterv10.ts index bcb259d..3c3232d 100644 --- a/Extension/PesterTask/src/pesterv10.ts +++ b/Extension/PesterTask/src/pesterv10.ts @@ -45,7 +45,7 @@ export async function run() { } // we need to not pass the null param - var args = ['"' + __dirname + "\\Pester.ps1" + '"', + var args = ['"' + __dirname + "/Pester.ps1" + '"', "-TestFolder", TestFolder, "-resultsFile", resultsFile, "-run32Bit", run32Bit, From 0c39766979b3c1028f4934bbe89477d9f48020bd Mon Sep 17 00:00:00 2001 From: Jay Miller Date: Fri, 4 Feb 2022 07:51:20 -0700 Subject: [PATCH 4/4] Revert manual argument quoting. Remove Windows-specific argument handling for spawn(). [Refs #63] --- Extension/PesterTask/src/pester.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Extension/PesterTask/src/pester.ts b/Extension/PesterTask/src/pester.ts index a09b597..4273679 100644 --- a/Extension/PesterTask/src/pester.ts +++ b/Extension/PesterTask/src/pester.ts @@ -45,7 +45,7 @@ export async function run() { } // we need to not pass the null param - var args = ['"' + __dirname + "\\Pester.ps1" + '"', + var args = [__dirname + "\\Pester.ps1", "-scriptFolder", scriptFolder, "-resultsFile", resultsFile, "-run32Bit", run32Bit, @@ -94,7 +94,7 @@ export async function run() { logInfo(`${executable} ${args.join(" ")}`); var spawn = require("child_process").spawn, child; - child = spawn(executable, args, {windowsVerbatimArguments: true}); + child = spawn(executable, args); child.stdout.on("data", function (data) { logInfo(data.toString()); });