-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.cake
119 lines (102 loc) · 5.53 KB
/
build.cake
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#load nuget:?package=TestCentric.Cake.Recipe&version=1.3.2
// Comment out above line and uncomment below for local tests of recipe changes
//#load ../TestCentric.Cake.Recipe/recipe/*.cake
var target = Argument("target", Argument("t", "Default"));
BuildSettings.Initialize
(
context: Context,
title: "Net50PluggableAgent",
solutionFile: "net50-pluggable-agent.sln",
unitTests: "**/*.tests.exe",
githubOwner: "TestCentric",
githubRepository: "net50-pluggable-agent"
);
var MockAssemblyResult = new ExpectedResult("Failed")
{
Total = 36, Passed = 23, Failed = 5, Warnings = 1, Inconclusive = 1, Skipped = 7,
Assemblies = new ExpectedAssemblyResult[] { new ExpectedAssemblyResult("mock-assembly.dll") }
};
var AspNetCoreResult = new ExpectedResult("Passed")
{
Total = 2, Passed = 2, Failed = 0, Warnings = 0, Inconclusive = 0, Skipped = 0,
Assemblies = new ExpectedAssemblyResult[] { new ExpectedAssemblyResult("aspnetcore-test.dll") }
};
var WindowsFormsResult = new ExpectedResult("Passed")
{
Total = 2, Passed = 2, Failed = 0, Warnings = 0, Inconclusive = 0, Skipped = 0,
Assemblies = new ExpectedAssemblyResult[] { new ExpectedAssemblyResult("windows-forms-test.dll") }
};
var PackageTests = new List<PackageTest>();
PackageTests.Add(new PackageTest(
1, "NetCore11PackageTest", "Run mock-assembly.dll targeting .NET Core 1.1",
"tests/netcoreapp1.1/mock-assembly.dll", MockAssemblyResult));
PackageTests.Add(new PackageTest(
1, "NetCore21PackageTest", "Run mock-assembly.dll targeting .NET Core 2.1",
"tests/netcoreapp2.1/mock-assembly.dll", MockAssemblyResult));
PackageTests.Add(new PackageTest(
1, "NetCore31PackageTest", "Run mock-assembly.dll targeting .NET Core 3.1",
"tests/netcoreapp3.1/mock-assembly.dll", MockAssemblyResult));
PackageTests.Add(new PackageTest(
1, "Net50PackageTest", "Run mock-assembly.dll targeting .NET 5.0",
"tests/net5.0/mock-assembly.dll --trace:Debug", MockAssemblyResult));
PackageTests.Add(new PackageTest(
1, $"AspNetCore31Test", $"Run test using AspNetCore targeting .NET Core 3.1",
$"tests/netcoreapp3.1/aspnetcore-test.dll", AspNetCoreResult));
PackageTests.Add(new PackageTest(
1, $"AspNetCore50Test", $"Run test using AspNetCore targeting .NET 5.0",
$"tests/net5.0/aspnetcore-test.dll", AspNetCoreResult));
if (!BuildSettings.IsRunningOnAppVeyor)
PackageTests.Add(new PackageTest(
1, "Net50WindowsFormsTest", $"Run test using windows forms under .NET 5.0",
"tests/net5.0-windows/windows-forms-test.dll", WindowsFormsResult));
BuildSettings.Packages.Add(new NuGetPackage(
"TestCentric.Extension.Net50PluggableAgent",
title: ".NET 5.0 Pluggable Agent",
description: "TestCentric engine extension for running tests under .NET 5.0",
tags: new [] { "testcentric", "pluggable", "agent", "net50" },
packageContent: new PackageContent()
.WithRootFiles("../../LICENSE.txt", "../../README.md", "../../testcentric.png")
.WithDirectories(
new DirectoryContent("tools").WithFiles(
"net50-agent-launcher.dll", "net50-agent-launcher.pdb",
"testcentric.extensibility.api.dll", "testcentric.engine.api.dll" ),
new DirectoryContent("tools/agent").WithFiles(
"agent/net50-agent.dll", "agent/net50-agent.pdb", "agent/net50-agent.dll.config",
"agent/net50-agent.deps.json", $"agent/net50-agent.runtimeconfig.json",
"agent/TestCentric.Agent.Core.dll",
"agent/testcentric.engine.api.dll", "agent/testcentric.extensibility.api.dll",
"agent/testcentric.extensibility.dll", "agent/testcentric.metadata.dll",
"agent/TestCentric.InternalTrace.dll",
"agent/Microsoft.Bcl.AsyncInterfaces.dll", "agent/Microsoft.Extensions.DependencyModel.dll",
"agent/System.Text.Encodings.Web.dll", "agent/System.Runtime.CompilerServices.Unsafe.dll",
"agent/System.Text.Json.dll") ),
testRunner: new AgentRunner(BuildSettings.NuGetTestDirectory + "TestCentric.Extension.Net50PluggableAgent." + BuildSettings.PackageVersion + "/tools/agent/net50-agent.dll"),
tests: PackageTests) );
BuildSettings.Packages.Add(new ChocolateyPackage(
"testcentric-extension-net50-pluggable-agent",
title: ".NET 50 Pluggable Agent",
description: "TestCentric engine extension for running tests under .NET 5.0",
tags: new [] { "testcentric", "pluggable", "agent", "net50" },
packageContent: new PackageContent()
.WithRootFiles("../../testcentric.png")
.WithDirectories(
new DirectoryContent("tools").WithFiles(
"../../LICENSE.txt", "../../README.md", "../../VERIFICATION.txt",
"net50-agent-launcher.dll", "net50-agent-launcher.pdb",
"testcentric.extensibility.api.dll", "testcentric.engine.api.dll" ),
new DirectoryContent("tools/agent").WithFiles(
"agent/net50-agent.dll", "agent/net50-agent.pdb", "agent/net50-agent.dll.config",
"agent/net50-agent.deps.json", $"agent/net50-agent.runtimeconfig.json",
"agent/TestCentric.Agent.Core.dll",
"agent/testcentric.engine.api.dll", "agent/testcentric.extensibility.api.dll",
"agent/testcentric.extensibility.dll", "agent/testcentric.metadata.dll",
"agent/TestCentric.InternalTrace.dll",
"agent/Microsoft.Bcl.AsyncInterfaces.dll", "agent/Microsoft.Extensions.DependencyModel.dll",
"agent/System.Text.Encodings.Web.dll", "agent/System.Runtime.CompilerServices.Unsafe.dll",
"agent/System.Text.Json.dll") ),
testRunner: new AgentRunner(BuildSettings.ChocolateyTestDirectory + "testcentric-extension-net50-pluggable-agent." + BuildSettings.PackageVersion + "/tools/agent/net50-agent.dll"),
tests: PackageTests) );
//////////////////////////////////////////////////////////////////////
// EXECUTION
//////////////////////////////////////////////////////////////////////
Build.Run();