From 3a11880ddf3c8d378c7b9cc8bb469f9faaa34edc Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 21 Nov 2023 22:19:33 +0200 Subject: [PATCH] .NET 8 Update Code Ref. UT --- .github/workflows/dotnet.yml | 10 +++++++++- .../.config/dotnet-tools.json | 2 +- .../GraphHealthChecks.Tests.csproj | 16 ++++++++-------- .../GraphQLHealthCheckTests.cs | 5 +++-- GraphHealthChecks/GraphHealthChecks.csproj | 9 ++++----- NOTES.md | 4 ++-- 6 files changed, 27 insertions(+), 19 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 13511bd..e61870f 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -16,10 +16,18 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Setup .NET + - name: Setup .NET 6 + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 6.0.x + - name: Setup .NET 7 uses: actions/setup-dotnet@v3 with: dotnet-version: 7.0.x + - name: Setup .NET 8 + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 8.0.x - name: Restore dependencies run: dotnet restore - name: Build diff --git a/GraphHealthChecks.Tests/.config/dotnet-tools.json b/GraphHealthChecks.Tests/.config/dotnet-tools.json index bcbea39..9b4de66 100644 --- a/GraphHealthChecks.Tests/.config/dotnet-tools.json +++ b/GraphHealthChecks.Tests/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "dotnet-reportgenerator-globaltool": { - "version": "5.1.20", + "version": "5.2.0", "commands": [ "reportgenerator" ] diff --git a/GraphHealthChecks.Tests/GraphHealthChecks.Tests.csproj b/GraphHealthChecks.Tests/GraphHealthChecks.Tests.csproj index 96c72b2..e7270f4 100644 --- a/GraphHealthChecks.Tests/GraphHealthChecks.Tests.csproj +++ b/GraphHealthChecks.Tests/GraphHealthChecks.Tests.csproj @@ -1,7 +1,7 @@ - net7.0 + net6.0;net7.0;net8.0 enable enable false @@ -9,16 +9,16 @@ - - - + + + - - + + - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/GraphHealthChecks.Tests/GraphQLHealthCheckTests.cs b/GraphHealthChecks.Tests/GraphQLHealthCheckTests.cs index f0819bc..9001246 100644 --- a/GraphHealthChecks.Tests/GraphQLHealthCheckTests.cs +++ b/GraphHealthChecks.Tests/GraphQLHealthCheckTests.cs @@ -6,6 +6,7 @@ using Microsoft.Extensions.Diagnostics.HealthChecks; using Microsoft.Extensions.Logging; using Moq.Contrib.HttpClient; +using HotChocolate.Utilities.Introspection; namespace GraphHealthChecks.Tests; @@ -192,11 +193,11 @@ public async Task ILoggerUnhealthyStitchedSchemaHttpClientReturnsErrorForSchema( .CheckHealthAsync(null!); Assert.Equal(HealthStatus.Unhealthy, result.Status); - Assert.IsAssignableFrom(result.Exception); + Assert.IsAssignableFrom(result.Exception); Assert.NotNull(result.Description); Assert.Contains("general", result.Description); - mockLogger.VerifyLog(m => m.LogError(It.IsAny(), It.IsAny(), It.IsAny()), Times.Once); + mockLogger.VerifyLog(m => m.LogError(It.IsAny(), It.IsAny(), It.IsAny()), Times.Once); } [Fact(DisplayName = "GraphQLHealthCheck - ILogger - Unhealthy Schema - No Auth")] diff --git a/GraphHealthChecks/GraphHealthChecks.csproj b/GraphHealthChecks/GraphHealthChecks.csproj index a5d0ed3..8690b03 100644 --- a/GraphHealthChecks/GraphHealthChecks.csproj +++ b/GraphHealthChecks/GraphHealthChecks.csproj @@ -1,13 +1,12 @@ - net6.0;net7.0 - 11.0 + net6.0;net7.0;net8.0 enable true true $(MSBuildProjectName) - 1.1.0 + 2.0.0 Adamos Fiakkas Graph Health Checks for HotChocolate Adamos Fiakkas @@ -17,7 +16,7 @@ git - - + + \ No newline at end of file diff --git a/NOTES.md b/NOTES.md index 4448f45..ec1aeb5 100644 --- a/NOTES.md +++ b/NOTES.md @@ -8,13 +8,13 @@ ## Tests - Run: `dotnet test /p:CollectCoverage=true /p:Threshold=80 /p:CoverletOutputFormat=cobertura /p:CoverletOutput='./coverage.cobertura.xml'` -- Report: `dotnet reportgenerator -reports:./coverage.cobertura.xml -targetdir:./TestResults -reporttypes:Html` +- Report: `dotnet reportgenerator -reports:./coverage.cobertura.net8.0.xml -targetdir:./TestResults -reporttypes:Html` In one Go! ```powershell dotnet test /p:CollectCoverage=true /p:Threshold=80 /p:CoverletOutputFormat=cobertura /p:CoverletOutput='./coverage.cobertura.xml' -dotnet reportgenerator -reports:./coverage.cobertura.xml -targetdir:./TestResults -reporttypes:Html +dotnet reportgenerator -reports:./coverage.cobertura.net8.0.xml -targetdir:./TestResults -reporttypes:Html ``` ## Info