Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add async fluent builder feature to TestPublisher #5934

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 23 additions & 44 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,34 +241,27 @@ Target "RunTests" (fun _ ->
| true -> !! "./src/**/*.Tests.*sproj"
++ "./src/**/Akka.Streams.Tests.TCK.csproj"
-- "./src/**/*.Tests.MultiNode.csproj"
-- "./src/**/*.Tests.Performance.csproj"
-- "./src/examples/**"
| _ -> !! "./src/**/*.Tests.*sproj" // if you need to filter specs for Linux vs. Windows, do it here
-- "./src/**/*.Tests.MultiNode.csproj"
-- "./src/**/*.Tests.Performance.csproj"
-- "./src/examples/**"
rawProjects |> Seq.choose filterProjects

let projectDlls = projects |> Seq.map ( fun project ->
let assemblyName = fileNameWithoutExt project
(directory project) @@ "bin" @@ "Release" @@ testNetFrameworkVersion @@ assemblyName + ".dll"
)

let runSingleProject projectDll =
let runSingleProject project =
let arguments =
match (hasTeamCity) with
| true -> (sprintf "test \"%s\" --blame-crash --blame-hang-timeout 25m -l:trx -l:\"console;verbosity=normal\" --framework %s --results-directory \"%s\" -- -teamcity" projectDll testNetFrameworkVersion outputTests)
| false -> (sprintf "test \"%s\" --blame-crash --blame-hang-timeout 25m -l:trx -l:\"console;verbosity=normal\" --framework %s --results-directory \"%s\"" projectDll testNetFrameworkVersion outputTests)
| true -> (sprintf "test -c Release --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s --results-directory \"%s\" -- -parallel none -teamcity" testNetFrameworkVersion outputTests)
| false -> (sprintf "test -c Release --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s --results-directory \"%s\" -- -parallel none" testNetFrameworkVersion outputTests)

let result = ExecProcess(fun info ->
info.FileName <- "dotnet"
info.WorkingDirectory <- outputTests
info.WorkingDirectory <- (Directory.GetParent project).FullName
info.Arguments <- arguments) (TimeSpan.FromMinutes 30.0)

ResultHandling.failBuildIfXUnitReportedError TestRunnerErrorLevel.Error result

CreateDir outputTests
projectDlls |> Seq.iter (runSingleProject)
projects |> Seq.iter (runSingleProject)
)

Target "RunTestsNetCore" (fun _ ->
Expand All @@ -278,34 +271,27 @@ Target "RunTestsNetCore" (fun _ ->
| true -> !! "./src/**/*.Tests.*sproj"
++ "./src/**/Akka.Streams.Tests.TCK.csproj"
-- "./src/**/*.Tests.MultiNode.csproj"
-- "./src/**/*.Tests.Performance.csproj"
-- "./src/examples/**"
| _ -> !! "./src/**/*.Tests.*sproj" // if you need to filter specs for Linux vs. Windows, do it here
-- "./src/**/*.Tests.MultiNode.csproj"
-- "./src/**/*.Tests.Performance.csproj"
-- "./src/examples/**"
rawProjects |> Seq.choose filterProjects

let projectDlls = projects |> Seq.map ( fun project ->
let assemblyName = fileNameWithoutExt project
(directory project) @@ "bin" @@ "Release" @@ testNetCoreVersion @@ assemblyName + ".dll"
)

let runSingleProject projectDll =
let runSingleProject project =
let arguments =
match (hasTeamCity) with
| true -> (sprintf "test \"%s\" --blame-crash --blame-hang-timeout 25m -l:trx -l:\"console;verbosity=normal\" --framework %s --results-directory \"%s\" -- -teamcity" projectDll testNetCoreVersion outputTests)
| false -> (sprintf "test \"%s\" --blame-crash --blame-hang-timeout 25m -l:trx -l:\"console;verbosity=normal\" --framework %s --results-directory \"%s\"" projectDll testNetCoreVersion outputTests)
| true -> (sprintf "test -c Release --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s --results-directory \"%s\" -- -parallel none -teamcity" testNetCoreVersion outputTests)
| false -> (sprintf "test -c Release --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s --results-directory \"%s\" -- -parallel none" testNetCoreVersion outputTests)

let result = ExecProcess(fun info ->
info.FileName <- "dotnet"
info.WorkingDirectory <- outputTests
info.WorkingDirectory <- (Directory.GetParent project).FullName
info.Arguments <- arguments) (TimeSpan.FromMinutes 30.0)

ResultHandling.failBuildIfXUnitReportedError TestRunnerErrorLevel.Error result

CreateDir outputTests
projectDlls |> Seq.iter (runSingleProject)
projects |> Seq.iter (runSingleProject)
)

Target "RunTestsNet" (fun _ ->
Expand All @@ -315,34 +301,27 @@ Target "RunTestsNet" (fun _ ->
| true -> !! "./src/**/*.Tests.*sproj"
++ "./src/**/Akka.Streams.Tests.TCK.csproj"
-- "./src/**/*.Tests.MultiNode.csproj"
-- "./src/**/*.Tests.Performance.csproj"
-- "./src/examples/**"
| _ -> !! "./src/**/*.Tests.*sproj" // if you need to filter specs for Linux vs. Windows, do it here
-- "./src/**/*.Tests.MultiNode.csproj"
-- "./src/**/*.Tests.Performance.csproj"
-- "./src/examples/**"
rawProjects |> Seq.choose filterProjects

let projectDlls = projects |> Seq.map ( fun project ->
let assemblyName = fileNameWithoutExt project
(directory project) @@ "bin" @@ "Release" @@ testNetVersion @@ assemblyName + ".dll"
)

let runSingleProject projectDll =
let runSingleProject project =
let arguments =
match (hasTeamCity) with
| true -> (sprintf "test \"%s\" --blame-crash --blame-hang-timeout 25m -l:trx -l:\"console;verbosity=normal\" --framework %s --results-directory \"%s\" -- -teamcity" projectDll testNetVersion outputTests)
| false -> (sprintf "test \"%s\" --blame-crash --blame-hang-timeout 25m -l:trx -l:\"console;verbosity=normal\" --framework %s --results-directory \"%s\"" projectDll testNetVersion outputTests)
| true -> (sprintf "test -c Release --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s --results-directory \"%s\" -- -parallel none -teamcity" testNetVersion outputTests)
| false -> (sprintf "test -c Release --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s --results-directory \"%s\" -- -parallel none" testNetVersion outputTests)

let result = ExecProcess(fun info ->
info.FileName <- "dotnet"
info.WorkingDirectory <- outputTests
info.WorkingDirectory <- (Directory.GetParent project).FullName
info.Arguments <- arguments) (TimeSpan.FromMinutes 30.0)

ResultHandling.failBuildIfXUnitReportedError TestRunnerErrorLevel.Error result

CreateDir outputTests
projectDlls |> Seq.iter (runSingleProject)
projects |> Seq.iter (runSingleProject)
)

Target "MultiNodeTestsNetCore" (fun _ ->
Expand All @@ -363,13 +342,13 @@ Target "MultiNodeTestsNetCore" (fun _ ->
let runSingleProject projectDll =
let arguments =
match (hasTeamCity) with
| true -> (sprintf "test \"%s\" -l:trx -l:\"console;verbosity=detailed\" --framework %s --results-directory \"%s\" -- -teamcity" projectDll testNetCoreVersion outputMultiNode)
| false -> (sprintf "test \"%s\" -l:trx -l:\"console;verbosity=detailed\" --framework %s --results-directory \"%s\"" projectDll testNetCoreVersion outputMultiNode)
| true -> (sprintf "test \"%s\" -l:\"console;verbosity=detailed\" --framework %s --results-directory \"%s\" -- -teamcity" projectDll testNetCoreVersion outputMultiNode)
| false -> (sprintf "test \"%s\" -l:\"console;verbosity=detailed\" --framework %s --results-directory \"%s\"" projectDll testNetCoreVersion outputMultiNode)

let resultPath = (directory projectDll)
File.WriteAllText(
(resultPath @@ "xunit.multinode.runner.json"),
(sprintf "{\"outputDirectory\":\"%s\"}" outputMultiNode).Replace("\\", "\\\\"))
(sprintf "{\"outputDirectory\":\"%s\", \"useBuiltInTrxReporter\":true}" outputMultiNode).Replace("\\", "\\\\"))

let result = ExecProcess(fun info ->
info.FileName <- "dotnet"
Expand Down Expand Up @@ -402,13 +381,13 @@ Target "MultiNodeTestsNet" (fun _ ->
let runSingleProject projectDll =
let arguments =
match (hasTeamCity) with
| true -> (sprintf "test \"%s\" -l:trx -l:\"console;verbosity=detailed\" --framework %s --results-directory \"%s\" -- -teamcity" projectDll testNetVersion outputMultiNode)
| false -> (sprintf "test \"%s\" -l:trx -l:\"console;verbosity=detailed\" --framework %s --results-directory \"%s\"" projectDll testNetVersion outputMultiNode)
| true -> (sprintf "test \"%s\" -l:\"console;verbosity=detailed\" --framework %s --results-directory \"%s\" -- -teamcity" projectDll testNetVersion outputMultiNode)
| false -> (sprintf "test \"%s\" -l:\"console;verbosity=detailed\" --framework %s --results-directory \"%s\"" projectDll testNetVersion outputMultiNode)

let resultPath = (directory projectDll)
File.WriteAllText(
(resultPath @@ "xunit.multinode.runner.json"),
(sprintf "{\"outputDirectory\":\"%s\"}" outputMultiNode).Replace("\\", "\\\\"))
(sprintf "{\"outputDirectory\":\"%s\", \"useBuiltInTrxReporter\":true}" outputMultiNode).Replace("\\", "\\\\"))

let result = ExecProcess(fun info ->
info.FileName <- "dotnet"
Expand Down
Loading