Skip to content

Allow users of nunit3 set environment variables in the runner - #2543

Merged
matthid merged 3 commits into
fsprojects:release/nextfrom
robertpi:add-support-for-env-var-to-nunit
Sep 9, 2020
Merged

matthid merged 3 commits into
fsprojects:release/nextfrom
robertpi:add-support-for-env-var-to-nunit

Conversation

@robertpi

Copy link
Copy Markdown
Contributor

I need this for an obscure reason, maybe other people will too?

I need this for an obscure reason, maybe other people will too?
@matthid

matthid commented Sep 3, 2020

Copy link
Copy Markdown
Member

Hey, thanks for sending in a PR :)
To be honest I'm a bit skeptical, because when this is needed people should fall back to the lower level APIs (ideally we return the CreateProcess instance somewhere). I quickly tried to find some other place we have this and found none. Do we have this somewhere else (Because if we decide to add this it should work similar to existing APIs)?

@robertpi

robertpi commented Sep 3, 2020

Copy link
Copy Markdown
Contributor Author

Seems the Fsi module is the thing to copy, there's some clever use of inlining in Process.setEnvironmentVariable that allows it operate on any type that has a Environment and WithEnvironment member.

I think it should be easy to change the PR to copy that pattern.

@robertpi

robertpi commented Sep 9, 2020

Copy link
Copy Markdown
Contributor Author

As the commit message says, we now do exactly what other task such as DotNet and Fsi do.

CreateProcess.fromRawCommandLine tool argLine
|> CreateProcess.withFramework
|> CreateProcess.withWorkingDirectory (getWorkingDir parameters)
|> CreateProcess.withEnvironment (parameters.Environment |> Map.toList)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We sill want to set the working directory, correct?

@matthid
matthid merged commit 514bb27 into fsprojects:release/next Sep 9, 2020
@matthid

matthid commented Sep 9, 2020

Copy link
Copy Markdown
Member

Thanks! Will probably take me a bit to release, but it will be part of the next one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants