-
Notifications
You must be signed in to change notification settings - Fork 99
Expand file tree
/
Copy pathTestTasks.fs
More file actions
95 lines (76 loc) · 4.12 KB
/
Copy pathTestTasks.fs
File metadata and controls
95 lines (76 loc) · 4.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
module TestTasks
open BlackFox.Fake
open Fake.DotNet
open Fake.Core
open ProjectInfo
open BasicTasks
let createTestBuildTask (name: string) (deps: BuildTask.TaskInfo list) (projects: ProjectInfo list) =
BuildTask.create name deps {
projects
|> List.iter (fun pInfo ->
let proj = pInfo.ProjFile
proj
|> DotNet.build (fun p ->
{
p with
MSBuildParams = { p.MSBuildParams with DisableInternalBinLog = true}
}
|> DotNet.Options.withCustomParams (Some "--no-dependencies -tl")
)
)
}
let buildTestsAll = createTestBuildTask "BuildTestsAll" [clean; build] (testBaseProjects @ testProjectsCore @ testProjectsExtensionsLibs)
let buildTestsCore = createTestBuildTask "BuildTestsCore" [clean; build] (testBaseProjects @ testProjectsCore)
let buildTestsExtensionsLibs = createTestBuildTask "BuildTestsExtensionsLibs" [clean; build] (testBaseProjects @ testProjectsExtensionsLibs)
let createRunTestTask (name: string) (deps: BuildTask.TaskInfo list) (projects: ProjectInfo list) =
BuildTask.create name deps {
projects
|> Seq.iter (fun testProjectInfo ->
Fake.DotNet.DotNet.test
(fun testParams ->
{ testParams with
Logger = Some "console;verbosity=detailed"
Configuration = DotNet.BuildConfiguration.fromString configuration
NoBuild = true
MSBuildParams = { testParams.MSBuildParams with DisableInternalBinLog = true }
}
|> DotNet.Options.withCustomParams (Some "-tl")
)
testProjectInfo.ProjFile
)
}
let createRunTestFastTask (name: string) (projects: ProjectInfo list) =
BuildTask.create name [] {
Trace.trace $"Running {name} without Clean, while letting dotnet test handle restore and incremental builds."
projects
|> Seq.iter (fun testProjectInfo ->
Fake.DotNet.DotNet.test
(fun testParams ->
{ testParams with
Logger = Some "console;verbosity=detailed"
Configuration = DotNet.BuildConfiguration.fromString configuration
MSBuildParams = { testParams.MSBuildParams with DisableInternalBinLog = true }
}
|> DotNet.Options.withCustomParams (Some "-tl")
)
testProjectInfo.ProjFile
)
}
let createRunSingleTestProjectFastTask (project: ProjectInfo) =
createRunTestFastTask $"Run{project.Name}Fast" [ project ]
/// runs the all test projects via `dotnet test`
let runTestsAll = createRunTestTask "RunTestsAll" [ clean; build; buildTestsAll ] (testProjectsCore @ testProjectsExtensionsLibs)
/// runs the core test projects via `dotnet test`
let runTestsCore = createRunTestTask "RunTestsCore" [ clean; build; buildTestsCore; buildTestsCore] testProjectsCore
/// runs the extension lib test projects via `dotnet test`
let runTestsExtensionLibs = createRunTestTask "RunTestsExtensionLibs" [ clean; build; buildTestsExtensionsLibs] testProjectsExtensionsLibs
/// runs all test projects via incremental `dotnet test`, without cleaning first.
let runTestsAllFast = createRunTestFastTask "RunTestsAllFast" (testProjectsCore @ testProjectsExtensionsLibs)
/// runs core test projects via incremental `dotnet test`, without cleaning first.
let runTestsCoreFast = createRunTestFastTask "RunTestsCoreFast" testProjectsCore
/// runs extension lib test projects via incremental `dotnet test`, without cleaning first.
let runTestsExtensionLibsFast = createRunTestFastTask "RunTestsExtensionLibsFast" testProjectsExtensionsLibs
/// runs the ImageExportTests project via incremental `dotnet test`, without cleaning first.
let runImageExportTestsFast = createRunSingleTestProjectFastTask ImageExportTestProject
/// runs the CSharpTests project via incremental `dotnet test`, without cleaning first.
let runCSharpTestsFast = createRunSingleTestProjectFastTask CSharpTestProject