diff --git a/.github/workflows/new-cli.yml b/.github/workflows/new-cli.yml
index 5fd7034189..ae9ec5d10d 100644
--- a/.github/workflows/new-cli.yml
+++ b/.github/workflows/new-cli.yml
@@ -53,4 +53,4 @@ jobs:
run: dotnet format ./new-cli --exclude ~/.nuget/packages --verify-no-changes
-
name: Test 'new-cli' solution
- run: dotnet test ./new-cli --no-build --verbosity normal
+ run: dotnet test --solution ./new-cli/GitVersion.slnx --no-build --verbosity normal
diff --git a/build/build/Tasks/Test/UnitTest.cs b/build/build/Tasks/Test/UnitTest.cs
index e66f91b2e9..71920b559d 100644
--- a/build/build/Tasks/Test/UnitTest.cs
+++ b/build/build/Tasks/Test/UnitTest.cs
@@ -69,25 +69,29 @@ private static void TestProjectForTarget(BuildContext context, FilePath project,
var projectName = $"{project.GetFilenameWithoutExtension()}.net{framework}";
var settings = new DotNetTestSettings
{
+ PathType = DotNetTestPathType.Project,
Framework = $"net{framework}",
- NoBuild = true,
- NoRestore = true,
Configuration = context.MsBuildConfiguration,
- TestAdapterPath = new(".")
+ MSBuildSettings = new()
};
+ settings.MSBuildSettings.SetContinuousIntegrationBuild(false);
var resultsPath = context.MakeAbsolute(testResultsPath.CombineWithFilePath($"{projectName}.results.xml"));
- settings.Loggers = [$"junit;LogFilePath={resultsPath}"];
+ settings.WithArgumentCustomization(args => args
+ .Append("--report-spekt-junit")
+ .Append("--report-spekt-junit-filename").AppendQuoted(resultsPath.FullPath)
+ );
- var coverletSettings = new CoverletSettings
- {
- CollectCoverage = true,
- CoverletOutputFormat = CoverletOutputFormat.cobertura,
- CoverletOutputDirectory = testResultsPath,
- CoverletOutputName = $"{projectName}.coverage.xml",
- Exclude = ["[GitVersion*.Tests]*", "[GitTools.Testing]*"]
- };
+ context.DotNetTest(project.FullPath, settings);
+ // var coverletSettings = new CoverletSettings
+ // {
+ // CollectCoverage = true,
+ // CoverletOutputFormat = CoverletOutputFormat.cobertura,
+ // CoverletOutputDirectory = testResultsPath,
+ // CoverletOutputName = $"{projectName}.coverage.xml",
+ // Exclude = ["[GitVersion*.Tests]*", "[GitTools.Testing]*"]
+ // };
- context.DotNetTest(project.FullPath, settings, coverletSettings);
+ // context.DotNetTest(project.FullPath, settings, coverletSettings);
}
}
diff --git a/global.json b/global.json
index 6c462afd3d..6f1a7e12fd 100644
--- a/global.json
+++ b/global.json
@@ -1,10 +1,13 @@
{
- "projects": [
- "build",
- "new-cli",
- "src"
- ],
- "sdk": {
- "version": "10.0.102"
- }
+ "projects": [
+ "build",
+ "new-cli",
+ "src"
+ ],
+ "sdk": {
+ "version": "10.0.102"
+ },
+ "test": {
+ "runner": "Microsoft.Testing.Platform"
+ }
}
diff --git a/new-cli/Directory.Packages.props b/new-cli/Directory.Packages.props
index 23d92a7ba7..3f48d34b09 100644
--- a/new-cli/Directory.Packages.props
+++ b/new-cli/Directory.Packages.props
@@ -20,7 +20,7 @@
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
diff --git a/new-cli/GitVersion.Cli.Generator.Tests/GitVersion.Cli.Generator.Tests.csproj b/new-cli/GitVersion.Cli.Generator.Tests/GitVersion.Cli.Generator.Tests.csproj
index 9478d94c71..7c28fa017a 100644
--- a/new-cli/GitVersion.Cli.Generator.Tests/GitVersion.Cli.Generator.Tests.csproj
+++ b/new-cli/GitVersion.Cli.Generator.Tests/GitVersion.Cli.Generator.Tests.csproj
@@ -1,19 +1,11 @@
-
- true
- true
-
-
- true
-
Exe
GitVersion.Cli.Generator.Tests
false
+
+ true
diff --git a/src/Directory.Build.props b/src/Directory.Build.props
index 7c34e46a90..01da3e71d9 100644
--- a/src/Directory.Build.props
+++ b/src/Directory.Build.props
@@ -33,12 +33,18 @@
true
false
- true
+ true
false
false
true
true
+ true
+
+
+
+ Exe
+ true
@@ -61,11 +67,9 @@
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
-
-
@@ -81,13 +85,13 @@
-
+
-
+
diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props
index a37d9932ff..dbe9294c42 100644
--- a/src/Directory.Packages.props
+++ b/src/Directory.Packages.props
@@ -6,7 +6,7 @@
-
+
@@ -20,10 +20,10 @@
-
+
-
+
@@ -36,7 +36,7 @@
-
+
diff --git a/src/GitVersion.Testing/GitVersion.Testing.csproj b/src/GitVersion.Testing/GitVersion.Testing.csproj
index 08c0eba912..b27579a5da 100644
--- a/src/GitVersion.Testing/GitVersion.Testing.csproj
+++ b/src/GitVersion.Testing/GitVersion.Testing.csproj
@@ -1,5 +1,6 @@
+ Library
false
true