Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
After a hint from @michaelsmithson in this comment, we found the source of the issue that causes the NUnit Console runner to fail.
I commented out that call for
withEnvironment
in create process and it indeed runs the tests in the given repro repository successfully without issues.Also, replacing
withEnvironment
withwithEnvironmentMap
runs successfully without issues. Further debugging the issue and I got a duplicate item error as shown below:The
withEnvironment
method callsEnvMap.ofSeq
from the Process module which has the following implementation:The
empty
is a new instance ofImmutableDictionary
.Comparing
withEnvironment
withwithEnvironmentMap
implemntations and the only difference is that, before adding the list of given environment variables, thewithEnvironmentMap
initializes the immutable collection with environment variables.So, trying to add
Clear
before adding the given list of environment variables inofSeq
with no luck, Also, checking items in the collection before adding an item and skipping any duplicates, resulted in the same error.What I ended up doing is initializing the empty immutable collection with environment variables before adding the given environment list. Same as
withEnvironmentMap
Another solution would be to just replace the
withEnvironment
withwithEnvironmentMap
in NUnit create process. But this will not solve the issue from its roots.TODO
Feel free to open the PR and ask for help
New (API-)documentation for new features exist (Note: API-docs are enough, additional docs are in
help/markdown
)unit or integration test exists (or short reasoning why it doesn't make sense)
boy scout rule: "leave the code behind in a better state than you found it" (fix warnings, obsolete members or code-style in the places you worked in)
(if new module) the module has been linked from the "Modules" menu, edit
help/templates/template.cshtml
, linking to the API-reference is fine.(if new module) the module is in the correct namespace
(if new module) the module is added to Fake.sln (
dotnet sln Fake.sln add src/app/Fake.*/Fake.*.fsproj
)Fake 5 API guideline is honored