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

Save results of each package test separately #1125

Merged
merged 1 commit into from
Feb 5, 2022
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
5 changes: 3 additions & 2 deletions cake/package-tester.cake
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ public class PackageTester

foreach (var packageTest in _packageTests)
{
var resultFile = _resultDirectory + "TestResult.xml";
var testResultDir = _resultDirectory + packageTest.Name + "/";
var resultFile = testResultDir + "TestResult.xml";

DisplayBanner(packageTest.Description);

Expand All @@ -93,7 +94,7 @@ public class PackageTester
_installDirectory + _testExecutable,
new ProcessSettings()
{
Arguments = $"{packageTest.Arguments} --work={_resultDirectory}",
Arguments = $"{packageTest.Arguments} --work={testResultDir}",
WorkingDirectory = outputDir
});

Expand Down
23 changes: 20 additions & 3 deletions cake/package-tests.cake
Original file line number Diff line number Diff line change
Expand Up @@ -13,90 +13,107 @@ static ExpectedResult MockAssemblyExpectedResult(int nCopies = 1) => new Expecte
};

static PackageTest Net35Test = new PackageTest(
"Net35Test",
"Run mock-assembly.dll under .NET 3.5",
"net35/mock-assembly.dll",
MockAssemblyExpectedResult(1));

static PackageTest Net35X86Test = new PackageTest(
"Net35X86Test",
"Run mock-assembly-x86.dll under .NET 3.5",
"net35/mock-assembly-x86.dll",
MockAssemblyExpectedResult(1));

static PackageTest Net40Test = new PackageTest(
"Net40Test",
"Run mock-assembly.dll under .NET 4.x",
"net40/mock-assembly.dll",
MockAssemblyExpectedResult(1));

static PackageTest Net40X86Test = new PackageTest(
"Net40X86Test",
"Run mock-assembly-x86.dll under .NET 4.x",
"net40/mock-assembly-x86.dll",
MockAssemblyExpectedResult(1));

static PackageTest Net35PlusNet40Test = new PackageTest(
"Net35PlusNet40Test",
"Run both copies of mock-assembly together",
"net35/mock-assembly.dll net40/mock-assembly.dll",
MockAssemblyExpectedResult(2));

static PackageTest Net60Test = new PackageTest(
"Net60Test",
"Run mock-assembly.dll under .NET 6.0",
"net6.0/mock-assembly.dll",
MockAssemblyExpectedResult(1));

static PackageTest Net50Test = new PackageTest(
"Net50Test",
"Run mock-assembly.dll under .NET 5.0",
"net5.0/mock-assembly.dll",
MockAssemblyExpectedResult(1));

static PackageTest NetCore31Test = new PackageTest(
"NetCore31Test",
"Run mock-assembly.dll under .NET Core 3.1",
"netcoreapp3.1/mock-assembly.dll",
MockAssemblyExpectedResult(1));

static PackageTest NetCore31X86Test = new PackageTest(
"NetCore31X86Test",
"Run mock-assembly-x86.dll under .NET Core 3.1",
"netcoreapp3.1/mock-assembly-x86.dll",
MockAssemblyExpectedResult(1));

static PackageTest NetCore21Test = new PackageTest(
"Run mock-assembly.dll targeting .NET Core 2.1",
"netcoreapp2.1/mock-assembly.dll",
"NetCore21Test",
"Run mock-assembly.dll targeting .NET Core 2.1",
"netcoreapp2.1/mock-assembly.dll",
MockAssemblyExpectedResult(1));

static PackageTest NetCore21X86Test = new PackageTest(
"NetCore21X86Test",
"Run mock-assembly-x86.dll under .NET Core 2.1",
"netcoreapp2.1/mock-assembly-x86.dll",
MockAssemblyExpectedResult(1));

static PackageTest NetCore21PlusNetCore31Test = new PackageTest(
"NetCore21PlusNetCore31Test",
"Run two copies of mock-assembly together",
"netcoreapp2.1/mock-assembly.dll netcoreapp3.1/mock-assembly.dll",
MockAssemblyExpectedResult(2));

static PackageTest NetCore21PlusNetCore31PlusNet50PlusNet60Test = new PackageTest(
"NetCore21PlusNetCore31PlusNet50PlusNet60Test",
"Run four copies of mock-assembly together",
"netcoreapp2.1/mock-assembly.dll netcoreapp3.1/mock-assembly.dll net5.0/mock-assembly.dll net6.0/mock-assembly.dll",
MockAssemblyExpectedResult(4));

static PackageTest Net40PlusNet60Test = new PackageTest(
"Net40PlusNet60Test",
"Run mock-assembly under .Net Framework 4.0 and .Net 6.0 together",
"net40/mock-assembly.dll net6.0/mock-assembly.dll",
MockAssemblyExpectedResult(2));

static PackageTest NUnitProjectTest;
NUnitProjectTest = new PackageTest(
"NUnitProjectTest",
"Run project with both copies of mock-assembly",
$"../../NetFXTests.nunit --config={Configuration}",
MockAssemblyExpectedResult(2));

// Representation of a single test to be run against a pre-built package.
public struct PackageTest
{
public string Name;
public string Description;
public string Arguments;
public ExpectedResult ExpectedResult;

public PackageTest(string description, string arguments, ExpectedResult expectedResult)
public PackageTest(string name, string description, string arguments, ExpectedResult expectedResult)
{
Name = name;
Description = description;
Arguments = arguments;
ExpectedResult = expectedResult;
Expand Down