Skip to content

Commit

Permalink
chore(ci): bump dailydevops/pipelines from 0.11.2 to 0.11.3 (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] authored Jun 24, 2024
1 parent a648e86 commit b24ca0b
Show file tree
Hide file tree
Showing 172 changed files with 42 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
jobs:
all:
name: Build & Tests
uses: dailydevops/pipelines/.github/workflows/[email protected].2
uses: dailydevops/pipelines/.github/workflows/[email protected].3
with:
enableSonarQube: true
dotnet-logging: ${{ inputs.dotnet-logging }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/// </summary>
public static class DependencyInjectionExtensions
{
private static readonly string[] _defaultTags = new[] { "redis" };
private static readonly string[] _defaultTags = ["redis"];

/// <summary>
/// Add a health check for Redis.
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
<ProjectReference Include="..\..\src\NetEvolve.HealthChecks.SQLite\NetEvolve.HealthChecks.SQLite.csproj" />
</ItemGroup>

<ItemGroup>
<Folder Include="_snapshot\" />
</ItemGroup>

<Import Project="..\..\..\HealthChecks.Shared\tests\NetEvolve.HealthChecks.Shared.Tests\NetEvolve.HealthChecks.Shared.Tests.projitems" Label="Shared" />

</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// #define AUTO_VERIFY

namespace NetEvolve.HealthChecks.Tests;
namespace NetEvolve.HealthChecks.Tests;

using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -33,10 +31,12 @@ protected async ValueTask RunAndVerify(
)
{
var builder = new WebHostBuilder()
.ConfigureAppConfiguration((_, configBuilder) =>
{
config?.Invoke(configBuilder);
})
.ConfigureAppConfiguration(
(_, configBuilder) =>
{
config?.Invoke(configBuilder);
}
)
.ConfigureServices(services =>
{
serviceBuilder?.Invoke(services);
Expand All @@ -45,10 +45,10 @@ protected async ValueTask RunAndVerify(
})
.Configure(app =>
{
_ = app.UseHealthChecks(HealthCheckPath, new HealthCheckOptions
{
ResponseWriter = WriteResponse
});
_ = app.UseHealthChecks(
HealthCheckPath,
new HealthCheckOptions { ResponseWriter = WriteResponse }
);
});

using (var server = new TestServer(builder))
Expand All @@ -61,34 +61,19 @@ protected async ValueTask RunAndVerify(
.GetAsync(new Uri(HealthCheckPath, UriKind.Relative))
.ConfigureAwait(false);
var resultContent = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
var content = string.IsNullOrWhiteSpace(resultContent) ? null : Argon.JToken.Parse(resultContent);
var content = string.IsNullOrWhiteSpace(resultContent)
? null
: Argon.JToken.Parse(resultContent);

if (clearJToken is not null)
{
content = clearJToken.Invoke(content);
}

_ = await Verifier
.Verify(content)
.UseDirectory(GetProjectDirectory())
#if AUTO_VERIFY
.AutoVerify()
#endif
.ConfigureAwait(true);
_ = await Verifier.Verify(content).ConfigureAwait(true);
}
}

private string GetProjectDirectory()
{
var directory = Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", "..", "..");
var projectName = GetType().Assembly.GetName().Name!;
var shortName = projectName[(projectName.IndexOf('.', StringComparison.OrdinalIgnoreCase) + 1)..];
shortName = shortName[..shortName.IndexOf(".Tests.", StringComparison.OrdinalIgnoreCase)];

var snapshotDirectory = Path.Combine(directory, shortName, "tests", projectName, "_snapshot");
return Path.GetFullPath(snapshotDirectory);
}

private static Task WriteResponse(HttpContext context, HealthReport report)
{
context.Response.ContentType = "application/json; charset=utf-8";
Expand Down Expand Up @@ -119,7 +104,10 @@ private static Task WriteResponse(HttpContext context, HealthReport report)
writer.WriteEndObject();
}

return context.Response.WriteAsync(Encoding.UTF8.GetString(memoryStream.ToArray()), cancellationToken: context.RequestAborted);
return context.Response.WriteAsync(
Encoding.UTF8.GetString(memoryStream.ToArray()),
cancellationToken: context.RequestAborted
);
}
}

Expand Down Expand Up @@ -169,7 +157,11 @@ private static void WriteData(Utf8JsonWriter writer, IReadOnlyDictionary<string,
writer.WriteEndObject();
}

[SuppressMessage("Performance", "CA1851:Possible multiple enumerations of 'IEnumerable' collection", Justification = "As designed.")]
[SuppressMessage(
"Performance",
"CA1851:Possible multiple enumerations of 'IEnumerable' collection",
Justification = "As designed."
)]
private static void WriteTags(Utf8JsonWriter writer, IEnumerable<string> tags)
{
if (!tags.Any())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
namespace NetEvolve.HealthChecks.Tests.Integration;

using System.IO;
using System.Runtime.CompilerServices;
using VerifyTests;
using VerifyXunit;

internal static class ModuleInitializer
{
Expand All @@ -10,5 +12,16 @@ public static void Init()
{
VerifierSettings.SortPropertiesAlphabetically();
VerifierSettings.SortJsonObjects();

VerifierSettings.AutoVerify(includeBuildServer: false);

Verifier.DerivePathInfo(
(sourceFile, projectDirectory, type, method) =>
{
var directory = Path.Combine(projectDirectory, "_snapshots");
_ = Directory.CreateDirectory(directory);
return new(directory, type.Name, method.Name);
}
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
<ProjectReference Include="..\..\src\NetEvolve.HealthChecks.SqlServer.Legacy\NetEvolve.HealthChecks.SqlServer.Legacy.csproj" />
</ItemGroup>

<ItemGroup>
<Folder Include="_snapshot\" />
</ItemGroup>

<Import Project="..\..\..\HealthChecks.Shared\tests\NetEvolve.HealthChecks.Shared.Tests\NetEvolve.HealthChecks.Shared.Tests.projitems" Label="Shared" />

</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
results: [
{
description: TestNoValues: Unexpected error.,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
results: [
{
description: TestNoValues: Unexpected error.,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>$(_TestTargetFrameworks)</TargetFrameworks>
Expand All @@ -25,10 +25,6 @@
<ProjectReference Include="..\..\src\NetEvolve.HealthChecks\NetEvolve.HealthChecks.csproj" />
</ItemGroup>

<ItemGroup>
<Folder Include="_snapshot\" />
</ItemGroup>

<Import Project="..\..\..\HealthChecks.Shared\tests\NetEvolve.HealthChecks.Shared.Tests\NetEvolve.HealthChecks.Shared.Tests.projitems" Label="Shared" />

</Project>

0 comments on commit b24ca0b

Please sign in to comment.