From 86b86b8f2499f7f5ea7a344d4a0951dc83f7ba09 Mon Sep 17 00:00:00 2001 From: Karol Zadora-Przylecki Date: Thu, 25 Jul 2024 17:02:13 -0700 Subject: [PATCH] Stop running tests on .NET 7 and run tests on .NET 8 --- .../DiagnosticsPipelineFactoryTests.cs | 8 ++++---- .../MetadataTests.cs | 4 ++-- .../Microsoft.Diagnostics.EventFlow.Core.Tests.csproj | 10 +++++----- .../EventSourceInputTests.cs | 2 +- ...Microsoft.Diagnostics.EventFlow.Inputs.Tests.csproj | 2 +- ...icrosoft.Diagnostics.EventFlow.Outputs.Tests.csproj | 2 +- ...ft.Diagnostics.EventFlow.ServiceFabric.Tests.csproj | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/test/Microsoft.Diagnostics.EventFlow.Core.Tests/DiagnosticsPipelineFactoryTests.cs b/test/Microsoft.Diagnostics.EventFlow.Core.Tests/DiagnosticsPipelineFactoryTests.cs index 9018b24..1e28822 100644 --- a/test/Microsoft.Diagnostics.EventFlow.Core.Tests/DiagnosticsPipelineFactoryTests.cs +++ b/test/Microsoft.Diagnostics.EventFlow.Core.Tests/DiagnosticsPipelineFactoryTests.cs @@ -11,7 +11,7 @@ using Microsoft.Diagnostics.EventFlow.Filters; using Microsoft.Diagnostics.EventFlow.HealthReporters; using Microsoft.Diagnostics.EventFlow.Inputs; -#if NET7_0 || NET6_0 || NETCOREAPP2_1 || NETCOREAPP3_1 +#if NET8_0 || NET6_0 || NETCOREAPP2_1 || NETCOREAPP3_1 using Microsoft.Diagnostics.EventFlow.Inputs.ActivitySource; #endif using Microsoft.Diagnostics.EventFlow.Metadata; @@ -512,7 +512,7 @@ public void CanCreateAllStandardPipelineItems() ""schemaVersion"": ""2016-08-11"" }"; -#elif NET6_0 || NET7_0 +#elif NET6_0 || NET8_0 string pipelineConfiguration = @" { ""inputs"": [ @@ -598,14 +598,14 @@ public void CanCreateAllStandardPipelineItems() , i => Assert.IsType(i) , i => Assert.IsType(i) #endif -#if NET7_0 || NET6_0 || NETCOREAPP2_1 || NETCOREAPP3_1 +#if NET8_0 || NET6_0 || NETCOREAPP2_1 || NETCOREAPP3_1 , i => Assert.IsType(i) #endif ); Assert.Collection(pipeline.Sinks, s => Assert.IsType(s.Output), -#if (!NET462 && !NET6_0 && !NET7_0) +#if (!NET462 && !NET6_0 && !NET8_0) s => Assert.IsType(s.Output), #endif s => Assert.IsType(s.Output), diff --git a/test/Microsoft.Diagnostics.EventFlow.Core.Tests/MetadataTests.cs b/test/Microsoft.Diagnostics.EventFlow.Core.Tests/MetadataTests.cs index 010c35b..3f4faeb 100644 --- a/test/Microsoft.Diagnostics.EventFlow.Core.Tests/MetadataTests.cs +++ b/test/Microsoft.Diagnostics.EventFlow.Core.Tests/MetadataTests.cs @@ -124,7 +124,7 @@ public void RequestDataReadSuccessfully() Assert.Equal("200 OK", rd.ResponseCode); // Note the TimeSpan.FromMilliseconds will round to the nearest millisecond on everything older than .NET Core 3.0 -#if NETCOREAPP3_1 || NET6_0 || NET7_0 +#if NETCOREAPP3_1 || NET6_0 || NET8_0 Assert.Equal(34.7, rd.Duration.Value.TotalMilliseconds, DoublePrecisionTolerance); #else Assert.Equal(35, rd.Duration.Value.TotalMilliseconds, DoublePrecisionTolerance); @@ -155,7 +155,7 @@ public void RequestDataReadSuccessfully() eventData.Payload["duration"] = 65.7; result = RequestData.TryGetData(eventData, requestMetadata, out rd); Assert.Equal(DataRetrievalStatus.Success, result.Status); -#if NETCOREAPP3_1 || NET6_0 || NET7_0 +#if NETCOREAPP3_1 || NET6_0 || NET8_0 Assert.Equal(65.7, rd.Duration.Value.TotalMilliseconds, DoublePrecisionTolerance); #else Assert.Equal(66, rd.Duration.Value.TotalMilliseconds, DoublePrecisionTolerance); diff --git a/test/Microsoft.Diagnostics.EventFlow.Core.Tests/Microsoft.Diagnostics.EventFlow.Core.Tests.csproj b/test/Microsoft.Diagnostics.EventFlow.Core.Tests/Microsoft.Diagnostics.EventFlow.Core.Tests.csproj index e7b7d99..7a62ea0 100644 --- a/test/Microsoft.Diagnostics.EventFlow.Core.Tests/Microsoft.Diagnostics.EventFlow.Core.Tests.csproj +++ b/test/Microsoft.Diagnostics.EventFlow.Core.Tests/Microsoft.Diagnostics.EventFlow.Core.Tests.csproj @@ -1,7 +1,7 @@  - net462;net471;net6.0;net7.0 + net462;net471;net6.0;net8.0 Microsoft.Diagnostics.EventFlow.Core.Tests true true @@ -46,10 +46,10 @@ - - - - + + + + diff --git a/test/Microsoft.Diagnostics.EventFlow.Inputs.Tests/EventSourceInputTests.cs b/test/Microsoft.Diagnostics.EventFlow.Inputs.Tests/EventSourceInputTests.cs index 1dd367c..7241a28 100644 --- a/test/Microsoft.Diagnostics.EventFlow.Inputs.Tests/EventSourceInputTests.cs +++ b/test/Microsoft.Diagnostics.EventFlow.Inputs.Tests/EventSourceInputTests.cs @@ -229,7 +229,7 @@ public async Task CapturesEventCountersFromEventSource() Assert.Equal("EventCounters", data.Payload["EventName"]); Assert.Equal("testCounter", data.Payload["Name"]); Assert.Equal(2, data.Payload["Count"]); -#if NETCOREAPP3_1 || NET6_0 || NET7_0 +#if NETCOREAPP3_1 || NET6_0 || NET8_0 Assert.Equal((double)5, data.Payload["Max"]); Assert.Equal((double)1, data.Payload["Min"]); #else diff --git a/test/Microsoft.Diagnostics.EventFlow.Inputs.Tests/Microsoft.Diagnostics.EventFlow.Inputs.Tests.csproj b/test/Microsoft.Diagnostics.EventFlow.Inputs.Tests/Microsoft.Diagnostics.EventFlow.Inputs.Tests.csproj index c5e0214..ea7a8a7 100644 --- a/test/Microsoft.Diagnostics.EventFlow.Inputs.Tests/Microsoft.Diagnostics.EventFlow.Inputs.Tests.csproj +++ b/test/Microsoft.Diagnostics.EventFlow.Inputs.Tests/Microsoft.Diagnostics.EventFlow.Inputs.Tests.csproj @@ -1,7 +1,7 @@  - net471;net6.0;net7.0 + net471;net6.0;net8.0 portable Microsoft.Diagnostics.EventFlow.Inputs.Tests true diff --git a/test/Microsoft.Diagnostics.EventFlow.Outputs.Tests/Microsoft.Diagnostics.EventFlow.Outputs.Tests.csproj b/test/Microsoft.Diagnostics.EventFlow.Outputs.Tests/Microsoft.Diagnostics.EventFlow.Outputs.Tests.csproj index de4cc66..64359f9 100644 --- a/test/Microsoft.Diagnostics.EventFlow.Outputs.Tests/Microsoft.Diagnostics.EventFlow.Outputs.Tests.csproj +++ b/test/Microsoft.Diagnostics.EventFlow.Outputs.Tests/Microsoft.Diagnostics.EventFlow.Outputs.Tests.csproj @@ -1,7 +1,7 @@  - net471;net6.0;net7.0 + net471;net6.0;net8.0 Microsoft.Diagnostics.EventFlow.Outputs.Tests true true diff --git a/test/Microsoft.Diagnostics.EventFlow.ServiceFabric.Tests/Microsoft.Diagnostics.EventFlow.ServiceFabric.Tests.csproj b/test/Microsoft.Diagnostics.EventFlow.ServiceFabric.Tests/Microsoft.Diagnostics.EventFlow.ServiceFabric.Tests.csproj index 56a6f99..72ca420 100644 --- a/test/Microsoft.Diagnostics.EventFlow.ServiceFabric.Tests/Microsoft.Diagnostics.EventFlow.ServiceFabric.Tests.csproj +++ b/test/Microsoft.Diagnostics.EventFlow.ServiceFabric.Tests/Microsoft.Diagnostics.EventFlow.ServiceFabric.Tests.csproj @@ -1,7 +1,7 @@  - net462;net471;net6.0;net7.0 + net462;net471;net6.0;net8.0 x64 portable Microsoft.Diagnostics.EventFlow.ServiceFabric.Tests