Skip to content

Commit afabca6

Browse files
committed
wip
1 parent cbaaf7d commit afabca6

File tree

6 files changed

+27
-24
lines changed

6 files changed

+27
-24
lines changed

.github/workflows/new-cli.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ jobs:
5353
run: dotnet format ./new-cli --exclude ~/.nuget/packages --verify-no-changes
5454
-
5555
name: Test 'new-cli' solution
56-
run: dotnet test ./new-cli --no-build --verbosity normal
56+
run: dotnet test --solution ./new-cli/GitVersion.slnx --no-build --verbosity normal

global.json

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
2-
"projects": [
3-
"build",
4-
"new-cli",
5-
"src"
6-
],
7-
"sdk": {
8-
"version": "10.0.101"
9-
}
2+
"projects": [
3+
"build",
4+
"new-cli",
5+
"src"
6+
],
7+
"sdk": {
8+
"version": "10.0.101"
9+
},
10+
"test": {
11+
"runner": "Microsoft.Testing.Platform"
12+
}
1013
}

new-cli/GitVersion.Cli.Generator.Tests/GitVersion.Cli.Generator.Tests.csproj

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<!-- Enable the NUnit runner, this is an opt-in feature -->
5-
<EnableNUnitRunner>true</EnableNUnitRunner>
6-
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
7-
8-
<!--
9-
Displays error on console in addition to the log file. Note that this feature comes with a performance impact.
10-
For more information, visit https://learn.microsoft.com/dotnet/core/testing/microsoft-testing-platform-integration-dotnet-test#show-failure-per-test
11-
-->
12-
<TestingPlatformShowTestsFailure>true</TestingPlatformShowTestsFailure>
13-
144
<OutputType>Exe</OutputType>
155
<RootNamespace>GitVersion.Cli.Generator.Tests</RootNamespace>
166
<IsPackable>false</IsPackable>
7+
8+
<EnableNUnitRunner>true</EnableNUnitRunner>
179
</PropertyGroup>
1810

1911
<ItemGroup>

src/Directory.Build.props

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,18 @@
3434

3535
<IsUnitTestProject>false</IsUnitTestProject>
3636
<DisableApiAnalyzers>false</DisableApiAnalyzers>
37-
<IsUnitTestProject Condition="$(MSBuildProjectName.EndsWith('.Tests')) or $(MSBuildProjectName.EndsWith('.Testing'))">true</IsUnitTestProject>
37+
<IsUnitTestProject Condition="$(MSBuildProjectName.EndsWith('.Tests'))">true</IsUnitTestProject>
3838
</PropertyGroup>
3939

4040
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
4141
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
4242
</PropertyGroup>
4343

44+
<PropertyGroup Condition=" '$(IsUnitTestProject)' == 'true' ">
45+
<OutputType>Exe</OutputType>
46+
<EnableNUnitRunner>true</EnableNUnitRunner>
47+
</PropertyGroup>
48+
4449
<ItemGroup>
4550
<PackageReference Include="Roslynator.Analyzers">
4651
<PrivateAssets>all</PrivateAssets>
@@ -51,7 +56,7 @@
5156
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
5257
</PackageReference>
5358
</ItemGroup>
54-
<ItemGroup Condition=" '$(IsUnitTestProject)' == 'false' and $(MSBuildProjectName.EndsWith('.Schema')) == 'false' and '$(DisableApiAnalyzers)' == 'false'">
59+
<ItemGroup Condition=" '$(DisableApiAnalyzers)' == 'false' and '$(IsUnitTestProject)' == 'false' and $(MSBuildProjectName.EndsWith('.Schema')) == 'false' and $(MSBuildProjectName.EndsWith('.Testing')) == 'false' ">
5560
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers">
5661
<PrivateAssets>all</PrivateAssets>
5762
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
@@ -64,7 +69,7 @@
6469

6570
<PackageReference Include="NUnit" />
6671
<PackageReference Include="NUnit3TestAdapter" />
67-
<PackageReference Include="JunitXml.TestLogger" />
72+
<!-- <PackageReference Include="JunitXml.TestLogger" />-->
6873
<PackageReference Include="Shouldly" />
6974

7075
<PackageReference Include="coverlet.msbuild">
@@ -77,13 +82,13 @@
7782
</PackageReference>
7883

7984
</ItemGroup>
80-
<ItemGroup Condition=" '$(IsUnitTestProject)' == 'true' and $(MSBuildProjectName.EndsWith('.Tests'))">
85+
<ItemGroup Condition=" '$(IsUnitTestProject)' == 'true' ">
8186
<ProjectReference Include="..\GitVersion.Testing\GitVersion.Testing.csproj" />
8287

83-
<Using Include="GitVersion.Testing" />
8488
<Using Include="NSubstitute" />
8589
<Using Include="NUnit.Framework" />
8690
<Using Include="Shouldly" />
91+
<Using Include="GitVersion.Testing" />
8792
</ItemGroup>
8893

8994
<ItemGroup>

src/GitVersion.Core.Tests/Core/DynamicRepositoryTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public void TearDown()
2121

2222
// Note: use same name twice to see if changing commits works on same (cached) repository
2323
[NonParallelizable]
24+
[Explicit]
2425
[TestCase("GV_main", "https://github.com/GitTools/GitVersion", MainBranch, "2dc142a4a4df77db61a00d9fb7510b18b3c2c85a", "5.8.2-47")]
2526
[TestCase("GV_main", "https://github.com/GitTools/GitVersion", MainBranch, "efddf2f92c539a9c27f1904d952dcab8fb955f0e", "5.8.2-56")]
2627
public void FindsVersionInDynamicRepo(string name, string url, string targetBranch, string commitId, string expectedFullSemVer)

src/GitVersion.Testing/GitVersion.Testing.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3+
<OutputType>Library</OutputType>
34
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
45
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
56
</PropertyGroup>
67
<ItemGroup>
78
<PackageReference Include="LibGit2Sharp" />
9+
<PackageReference Include="Shouldly" />
810
<PackageReference Include="System.IO.Abstractions" />
911
<PackageReference Include="System.Reflection.Metadata" />
1012
</ItemGroup>

0 commit comments

Comments
 (0)