Skip to content

Commit

Permalink
Write the NUnit arguements to a temp file and pass that to NUnit console
Browse files Browse the repository at this point in the history
  • Loading branch information
BlythMeister committed Sep 27, 2018
1 parent e7e9c10 commit f5ef276
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/app/Fake.DotNet.Testing.NUnit/NUnit3.fs
Expand Up @@ -316,7 +316,11 @@ let run (setParams : NUnit3Params -> NUnit3Params) (assemblies : string seq) =
let assemblies = assemblies |> Seq.toArray
if Array.isEmpty assemblies then failwith "NUnit: cannot run tests (the assembly list is empty)."
let tool = parameters.ToolPath
let args = buildArgs parameters assemblies
let generatedArgs = buildArgs parameters assemblies
let path = Path.Combine(Path.GetTempPath(), (sprintf "%s.txt" (Guid.NewGuid().ToString())))
File.WriteAllText(path, generatedArgs)
Trace.trace(sprintf "Saved args to '%s' with value: %s" path generatedArgs)
let args = (sprintf "@%s" path)
Trace.trace (tool + " " + args)
let processTimeout = TimeSpan.MaxValue // Don't set a process timeout. The timeout is per test.
let result =
Expand All @@ -325,6 +329,9 @@ let run (setParams : NUnit3Params -> NUnit3Params) (assemblies : string seq) =
FileName = tool
WorkingDirectory = getWorkingDir parameters
Arguments = args }) >> Process.withFramework) processTimeout

File.Delete(path)

let errorDescription error =
match error with
| OK -> "OK"
Expand Down

0 comments on commit f5ef276

Please sign in to comment.