Skip to content

Commit

Permalink
.NET 8 Update
Browse files Browse the repository at this point in the history
Code Ref.
UT
  • Loading branch information
fiakkasa committed Nov 21, 2023
1 parent a05863c commit 3a11880
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 19 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion GraphHealthChecks.Tests/.config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"dotnet-reportgenerator-globaltool": {
"version": "5.1.20",
"version": "5.2.0",
"commands": [
"reportgenerator"
]
Expand Down
16 changes: 8 additions & 8 deletions GraphHealthChecks.Tests/GraphHealthChecks.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="HotChocolate.AspNetCore" Version="13.5.0" />
<PackageReference Include="HotChocolate.AspNetCore.Authorization" Version="13.5.0" />
<PackageReference Include="HotChocolate.Stitching" Version="13.5.0" />
<PackageReference Include="HotChocolate.AspNetCore" Version="13.7.0" />
<PackageReference Include="HotChocolate.AspNetCore.Authorization" Version="13.7.0" />
<PackageReference Include="HotChocolate.Stitching" Version="13.7.0" />
<PackageReference Include="ILogger.Moq" Version="1.1.10" />
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.1" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="7.0.10" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="8.0.0" />
<PackageReference Include="Moq.Contrib.HttpClient" Version="1.4.0" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
5 changes: 3 additions & 2 deletions GraphHealthChecks.Tests/GraphQLHealthCheckTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Microsoft.Extensions.Logging;
using Moq.Contrib.HttpClient;
using HotChocolate.Utilities.Introspection;

namespace GraphHealthChecks.Tests;

Expand Down Expand Up @@ -192,11 +193,11 @@ public async Task ILoggerUnhealthyStitchedSchemaHttpClientReturnsErrorForSchema(
.CheckHealthAsync(null!);

Assert.Equal(HealthStatus.Unhealthy, result.Status);
Assert.IsAssignableFrom<HttpRequestException>(result.Exception);
Assert.IsAssignableFrom<IntrospectionException>(result.Exception);
Assert.NotNull(result.Description);
Assert.Contains("general", result.Description);

mockLogger.VerifyLog(m => m.LogError(It.IsAny<HttpRequestException?>(), It.IsAny<string?>(), It.IsAny<object>()), Times.Once);
mockLogger.VerifyLog(m => m.LogError(It.IsAny<IntrospectionException?>(), It.IsAny<string?>(), It.IsAny<object>()), Times.Once);
}

[Fact(DisplayName = "GraphQLHealthCheck - ILogger - Unhealthy Schema - No Auth")]
Expand Down
9 changes: 4 additions & 5 deletions GraphHealthChecks/GraphHealthChecks.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<LangVersion>11.0</LangVersion>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<Nullable>enable</Nullable>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageId>$(MSBuildProjectName)</PackageId>
<Version>1.1.0</Version>
<Version>2.0.0</Version>
<Authors>Adamos Fiakkas</Authors>
<Description>Graph Health Checks for HotChocolate</Description>
<Copyright>Adamos Fiakkas</Copyright>
Expand All @@ -17,7 +16,7 @@
<RepositoryType>git</RepositoryType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="7.0.10" />
<PackageReference Include="HotChocolate.Execution" Version="13.5.0" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="8.0.0" />
<PackageReference Include="HotChocolate.Execution" Version="13.7.0" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3a11880

Please sign in to comment.