Skip to content

Commit 0c3f0f7

Browse files
committed
Add OS platform checks to deterministic msbuild tests
Modified `Msbuild` and `Msbuild_SourceLink` test methods to skip execution on Linux
1 parent 3cd1843 commit 0c3f0f7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/coverlet.integration.tests/DeterministicBuild.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.IO;
66
using System.Linq;
77
using System.Reflection;
8+
using System.Runtime.InteropServices;
89
using System.Xml.Linq;
910
using Coverlet.Core;
1011
using Coverlet.Tests.Utils;
@@ -87,6 +88,7 @@ private protected void AssertCoverage(string standardOutput = "", bool checkDete
8788
[Fact]
8889
public void Msbuild()
8990
{
91+
Assert.SkipWhen(RuntimeInformation.IsOSPlatform(OSPlatform.Linux), "Test requires Windows");
9092
string testResultPath = Path.Join(_testResultsPath, $"{TestContext.Current.TestClass?.TestClassName}.{TestContext.Current.TestMethod?.MethodName}");
9193
string logFilename = $"{TestContext.Current.TestClass?.TestClassName}.{TestContext.Current.TestMethod?.MethodName}.binlog";
9294
CreateDeterministicTestPropsFile();
@@ -130,6 +132,7 @@ public void Msbuild()
130132
[Fact]
131133
public void Msbuild_SourceLink()
132134
{
135+
Assert.SkipWhen(RuntimeInformation.IsOSPlatform(OSPlatform.Linux), "Test requires Windows");
133136
string testResultPath = Path.Join(_testResultsPath, $"{TestContext.Current.TestClass?.TestClassName}.{TestContext.Current.TestMethod?.MethodName}");
134137
string logFilename = $"{TestContext.Current.TestClass?.TestClassName}.{TestContext.Current.TestMethod?.MethodName}.binlog";
135138
CreateDeterministicTestPropsFile();

0 commit comments

Comments
 (0)