Skip to content

Commit

Permalink
Forward env variables in test debugging (#1951)
Browse files Browse the repository at this point in the history
Issue #1946
Node will override all env variables if you pass an env argument.
So we need to modify the parent process env
  • Loading branch information
farlee2121 committed Oct 20, 2023
1 parent 3e043e2 commit e607bdf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Components/TestExplorer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,12 @@ module DotnetCli =
launchDebugger processId
isDebuggerStarted <- true

let env = {| VSTEST_HOST_DEBUG = 1 |} |> box |> Some
let env =
let parentEnv = Node.Api.``process``.env
let childEnv = parentEnv
childEnv?VSTEST_HOST_DEBUG <- 1
childEnv |> box |> Some

Process.execWithCancel "dotnet" (ResizeArray(args)) env tryLaunchDebugger cancellationToken
| NoDebug -> Process.execWithCancel "dotnet" (ResizeArray(args)) None ignore cancellationToken

Expand Down

0 comments on commit e607bdf

Please sign in to comment.