From 719294081d7534b10fc716848482e2fd9f936169 Mon Sep 17 00:00:00 2001 From: Bert Date: Sun, 13 Apr 2025 11:02:26 +0200 Subject: [PATCH 1/2] enable skipped tests --- global.json | 2 +- .../Coverage/CoverageTests.AsyncAwait.cs | 2 +- .../Coverage/CoverageTests.DoesNotReturn.cs | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/global.json b/global.json index 6dfc6666e..0417b6523 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "8.0.407" + "version": "8.0.408" } } diff --git a/test/coverlet.core.coverage.tests/Coverage/CoverageTests.AsyncAwait.cs b/test/coverlet.core.coverage.tests/Coverage/CoverageTests.AsyncAwait.cs index 2cd661086..958a76a59 100644 --- a/test/coverlet.core.coverage.tests/Coverage/CoverageTests.AsyncAwait.cs +++ b/test/coverlet.core.coverage.tests/Coverage/CoverageTests.AsyncAwait.cs @@ -102,7 +102,7 @@ public void AsyncAwait_Issue_669_1() } } - [Fact(Skip = "Unhandled exception: System.InvalidOperationException: Sequence contains more than one matching element, InstrumenterHelper.cs:line 139 ")] + [Fact] public void AsyncAwait_Issue_669_2() { string path = Path.GetTempFileName(); diff --git a/test/coverlet.core.coverage.tests/Coverage/CoverageTests.DoesNotReturn.cs b/test/coverlet.core.coverage.tests/Coverage/CoverageTests.DoesNotReturn.cs index 408ac6417..6babc6738 100644 --- a/test/coverlet.core.coverage.tests/Coverage/CoverageTests.DoesNotReturn.cs +++ b/test/coverlet.core.coverage.tests/Coverage/CoverageTests.DoesNotReturn.cs @@ -47,7 +47,7 @@ public void NoBranches_DoesNotReturnAttribute_InstrumentsCorrect() } } - [Fact(Skip = "xunit.v3 '(Explicit=true)' (System.Console.ReadKey, Instrumentation.DoesNotReturn.cs line 22) ")] + [Fact] public void If_DoesNotReturnAttribute_InstrumentsCorrect() { string path = Path.GetTempFileName(); @@ -78,7 +78,7 @@ public void If_DoesNotReturnAttribute_InstrumentsCorrect() } } - [Fact(Skip = "xunit.v3 '(Explicit=true)' (System.Console.ReadKey, Instrumentation.DoesNotReturn.cs line 36) ")] + [Fact] public void Switch_DoesNotReturnAttribute_InstrumentsCorrect() { string path = Path.GetTempFileName(); @@ -109,7 +109,7 @@ public void Switch_DoesNotReturnAttribute_InstrumentsCorrect() } } - [Fact(Skip = "xunit.v3 '(Explicit=true)' (System.Console.ReadKey, Instrumentation.DoesNotReturn.cs line 37) ")] + [Fact] public void Subtle_DoesNotReturnAttribute_InstrumentsCorrect() { string path = Path.GetTempFileName(); @@ -140,7 +140,7 @@ public void Subtle_DoesNotReturnAttribute_InstrumentsCorrect() } } - [Fact(Skip = "xunit.v3 '(Explicit=true)' (System.Console.ReadKey, Instrumentation.DoesNotReturn.cs line 107) ")] + [Fact] public void UnreachableBranch_DoesNotReturnAttribute_InstrumentsCorrect() { string path = Path.GetTempFileName(); From 172829786ddcf40950196bf2702cfb9843990c3a Mon Sep 17 00:00:00 2001 From: Bert Date: Mon, 14 Apr 2025 11:05:37 +0200 Subject: [PATCH 2/2] skip AsyncAwait_Issue_669_2 on Windows --- Directory.Packages.props | 8 ++++---- .../Coverage/CoverageTests.AsyncAwait.cs | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index eba94e254..78b9d1912 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -54,18 +54,18 @@ - + - + - + - + diff --git a/test/coverlet.core.coverage.tests/Coverage/CoverageTests.AsyncAwait.cs b/test/coverlet.core.coverage.tests/Coverage/CoverageTests.AsyncAwait.cs index 958a76a59..7ede65ced 100644 --- a/test/coverlet.core.coverage.tests/Coverage/CoverageTests.AsyncAwait.cs +++ b/test/coverlet.core.coverage.tests/Coverage/CoverageTests.AsyncAwait.cs @@ -3,6 +3,7 @@ using System.IO; using System.Reflection; +using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; using Coverlet.Core; @@ -105,6 +106,8 @@ public void AsyncAwait_Issue_669_1() [Fact] public void AsyncAwait_Issue_669_2() { + // fails on CI with Windows OS - unknown reason - successfully executed locally (CLI) + Assert.SkipWhen(RuntimeInformation.IsOSPlatform(OSPlatform.Windows), "This test is skipped on Windows for CI environment"); string path = Path.GetTempFileName(); try {