Skip to content

Commit 22b8be5

Browse files
committed
skip running tests with NoNet48 category
skip running tests with NoNet48 category skip running tests with NoNet48 category skip running tests with NoNet48 category skip running tests with NoNet48 category skip running tests with NoNet48 category skip running tests with NoNet48 category
1 parent 90b3597 commit 22b8be5

File tree

12 files changed

+34
-21
lines changed

12 files changed

+34
-21
lines changed

build/test.cake

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,15 @@ Task("UnitTest")
3939
Exclude = new List<string> { "[GitVersion*.Tests]*", "[GitVersionTask.MsBuild]*" }
4040
};
4141

42-
if (IsRunningOnUnix() && string.Equals(framework, parameters.FullFxVersion48))
42+
if (string.Equals(framework, parameters.FullFxVersion48))
4343
{
44-
settings.Filter = "TestCategory!=NoMono";
44+
if (IsRunningOnUnix()) {
45+
settings.Filter = "TestCategory!=NoMono";
46+
} else {
47+
settings.Filter = "TestCategory!=NoNet48";
48+
}
4549
}
46-
50+
4751
DotNetCoreTest(project.FullPath, settings, coverletSettings);
4852
});
4953
}

src/GitVersionCore.Tests/Configuration/ConfigProviderTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ public void NextVersionCanHavePatch()
198198

199199
[Test]
200200
[MethodImpl(MethodImplOptions.NoInlining)]
201-
[Category("NoMono")]
202-
[Description("Won't run on Mono due to source information not being available for ShouldMatchApproved.")]
201+
[Category(NoMono)]
202+
[Description(NoMonoDescription)]
203203
public void CanWriteOutEffectiveConfiguration()
204204
{
205205
var config = configProvider.Provide(repoPath);

src/GitVersionCore.Tests/Configuration/Init/InitScenarios.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public void Setup()
2121
}
2222

2323
[Test]
24-
[Category("NoMono")]
25-
[Description("Won't run on Mono due to source information not being available for ShouldMatchApproved.")]
24+
[Category(NoMono)]
25+
[Description(NoMonoDescription)]
2626
public void CanSetNextVersion()
2727
{
2828
var workingDirectory = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "c:\\proj" : "/proj";

src/GitVersionCore.Tests/Core/GitVersionExecutorTests.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ public void GitPreparerShouldNotFailWhenTargetPathNotInitialized()
7979
}
8080

8181
[Test]
82-
[Category("NoMono")]
83-
[Description("LibGit2Sharp fails here when running under Mono")]
82+
[Category(NoMono)]
83+
[Description(NoMonoDescription)]
8484
public void CacheKeyForWorktree()
8585
{
8686
using var fixture = new EmptyRepositoryFixture();
@@ -409,8 +409,8 @@ public void WorkingDirectoryWithoutCommits()
409409
}
410410

411411
[Test]
412-
[Category("NoMono")]
413-
[Description("LibGit2Sharp fails when running under Mono")]
412+
[Category(NoMono)]
413+
[Description(NoMonoDescription)]
414414
public void GetProjectRootDirectoryWorkingDirectoryWithWorktree()
415415
{
416416
using var fixture = new EmptyRepositoryFixture();
@@ -497,8 +497,8 @@ public void GetDotGitDirectoryNoWorktree()
497497
}
498498

499499
[Test]
500-
[Category("NoMono")]
501-
[Description("LibGit2Sharp fails when running under Mono")]
500+
[Category(NoMono)]
501+
[Description(NoMonoDescription)]
502502
public void GetDotGitDirectoryWorktree()
503503
{
504504
using var fixture = new EmptyRepositoryFixture();
@@ -528,8 +528,8 @@ public void GetDotGitDirectoryWorktree()
528528
}
529529

530530
[Test]
531-
[Category("NoMono")]
532-
[Description("LibGit2Sharp fails when running under Mono")]
531+
[Category(NoMono)]
532+
[Description(NoMonoDescription)]
533533
public void CalculateVersionFromWorktreeHead()
534534
{
535535
// Setup

src/GitVersionCore.Tests/Helpers/TestBase.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public class TestBase
1313
{
1414
protected const string NoMonoDescription = "Won't run on Mono due to source information not being available for ShouldMatchApproved.";
1515
protected const string NoMono = "NoMono";
16+
protected const string NoNet48 = "NoNet48";
1617

1718
protected static IServiceProvider ConfigureServices(Action<IServiceCollection> overrideServices = null)
1819
{

src/GitVersionCore.Tests/IntegrationTests/WorktreeScenarios.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ public class WorktreeScenarios : TestBase
1212
{
1313

1414
[Test]
15-
[Category("NoMono")]
16-
[Description("LibGit2Sharp fails here when running under Mono")]
15+
[Category(NoMono)]
16+
[Description(NoMonoDescription)]
1717
public void UseWorktreeRepositoryForVersion()
1818
{
1919
using var fixture = new EmptyRepositoryFixture();

src/GitVersionCore.Tests/VersionCalculation/JsonVersionBuilderTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ public void Setup()
1818
}
1919

2020
[Test]
21-
[Category("NoMono")]
22-
[Description("Won't run on Mono due to source information not being available for ShouldMatchApproved.")]
21+
[Category(NoMono)]
22+
[Description(NoMonoDescription)]
2323
public void Json()
2424
{
2525
var semanticVersion = new SemanticVersion

src/GitVersionCore.Tests/VersionConverters/GitVersionInfoGeneratorTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ public void Setup()
2323
[TestCase("cs")]
2424
[TestCase("fs")]
2525
[TestCase("vb")]
26-
[Category("NoMono")]
27-
[Description("Won't run on Mono due to source information not being available for ShouldMatchApproved.")]
26+
[Category(NoMono)]
27+
[Description(NoMonoDescription)]
2828
public void ShouldCreateFile(string fileExtension)
2929
{
3030
var directory = Path.GetTempPath();

src/GitVersionTask.Tests/GenerateGitVersionInformationTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public void GenerateGitVersionInformationTaskShouldCreateFileInBuildServer()
5353
}
5454

5555
[Test]
56+
[Category(NoNet48)]
5657
[Category(NoMono)]
5758
public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuild()
5859
{
@@ -82,6 +83,7 @@ public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuild(
8283
}
8384

8485
[Test]
86+
[Category(NoNet48)]
8587
[Category(NoMono)]
8688
public void GenerateGitVersionInformationTaskShouldCreateFileWhenRunWithMsBuildInBuildServer()
8789
{

src/GitVersionTask.Tests/GetVersionTaskTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public void GetVersionTaskShouldReturnVersionOutputVariablesForBuildServer()
6464
[TestCase(nameof(VersionVariables.Patch), "4")]
6565
[TestCase(nameof(VersionVariables.MajorMinorPatch), "1.2.4")]
6666
[TestCase(nameof(VersionVariables.FullSemVer), "1.2.4+1")]
67+
[Category(NoNet48)]
6768
[Category(NoMono)]
6869
public void GetVersionTaskShouldReturnVersionOutputVariablesWhenRunWithMsBuild(string outputProperty, string version)
6970
{
@@ -87,6 +88,7 @@ public void GetVersionTaskShouldReturnVersionOutputVariablesWhenRunWithMsBuild(s
8788
[TestCase(nameof(VersionVariables.Patch), "1")]
8889
[TestCase(nameof(VersionVariables.MajorMinorPatch), "1.0.1")]
8990
[TestCase(nameof(VersionVariables.FullSemVer), "1.0.1+1")]
91+
[Category(NoNet48)]
9092
[Category(NoMono)]
9193
public void GetVersionTaskShouldReturnVersionOutputVariablesWhenRunWithMsBuildInBuildServer(string outputProperty, string version)
9294
{

0 commit comments

Comments
 (0)