Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,16 @@ jobs:
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: Sign packages
env:
AZURE_KEY_VAULT_URL: ${{ secrets.AZURE_KEY_VAULT_URL }}
AZURE_SIGN_CERTIFICATE_ID: ${{ secrets.AZURE_SIGN_CERTIFICATE_ID }}
run: >-
sign code azure-key-vault '**/*.nupkg'
--base-directory '${{ github.workspace }}/packages'
--azure-key-vault-managed-identity true
--azure-credential-type 'azure-cli'
--azure-key-vault-url '${{ secrets.AZURE_KEY_VAULT_URL }}'
--azure-key-vault-certificate '${{ secrets.AZURE_SIGN_CERTIFICATE_ID }}'
--azure-key-vault-url "$AZURE_KEY_VAULT_URL"
--azure-key-vault-certificate "$AZURE_SIGN_CERTIFICATE_ID"
--publisher-name 'Steeltoe'
--description 'Steeltoe'
--description-url 'https://steeltoe.io/'
Expand Down Expand Up @@ -249,7 +252,9 @@ jobs:
path: packages

- name: Push packages to nuget.org
run: dotnet nuget push '${{ github.workspace }}/packages/*.nupkg' --skip-duplicate --api-key '${{ secrets.STEELTOE_NUGET_API_KEY }}' --source 'nuget.org'
env:
STEELTOE_NUGET_API_KEY: ${{ secrets.STEELTOE_NUGET_API_KEY }}
run: dotnet nuget push '${{ github.workspace }}/packages/*.nupkg' --skip-duplicate --api-key "$STEELTOE_NUGET_API_KEY" --source 'nuget.org'

open_pr:
name: Open pull request to bump Steeltoe version after stable release
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sonarcube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: >-
dotnet sonarscanner begin /k:"SteeltoeOSS_steeltoe" /o:"steeltoeoss" /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
dotnet sonarscanner begin /k:"SteeltoeOSS_steeltoe" /o:"steeltoeoss" /d:sonar.token="$SONAR_TOKEN"
/d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths=**/coverage.opencover.xml

- name: Restore packages
Expand All @@ -106,4 +106,4 @@ jobs:
if: ${{ !cancelled() && steps.sonar_begin.outcome == 'success' }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: dotnet sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
run: dotnet sonarscanner end /d:sonar.token="$SONAR_TOKEN"
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ public async Task PostgreSQL_Not_Connected_Returns_Down_Status()
result.Description.Should().Be("PostgreSQL health check failed");
result.Details.Should().Contain("host", "localhost");
result.Details.Should().Contain("service", "Example");
result.Details.Should().ContainKey("error").WhoseValue.As<string>().Should().StartWith("NpgsqlException: ");

result.Details.Should().ContainKey("error").WhoseValue.As<string>().Should().Match(error =>
error.StartsWith("NpgsqlException: ", StringComparison.Ordinal) || error.StartsWith("TimeoutException: ", StringComparison.Ordinal));
}

[Fact(Skip = "Integration test - Requires local PostgreSQL server")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,10 @@ public async Task AddEurekaDiscoveryClient_uses_health_check_handler()
builder.Services.AddEurekaDiscoveryClient();

var handler = new DelegateToMockHttpClientHandler();
handler.Mock.Expect(HttpMethod.Post, "http://localhost:8761/eureka/apps/FOO").Respond(HttpStatusCode.NoContent);
handler.Mock.Expect(HttpMethod.Put, "http://localhost:8761/eureka/apps/FOO/localhost%3Afoo").Respond("application/json", "{}");
MockedRequest registerMock = handler.Mock.When(HttpMethod.Post, "http://localhost:8761/eureka/apps/FOO").Respond(HttpStatusCode.NoContent);

MockedRequest heartbeatMock =
handler.Mock.When(HttpMethod.Put, "http://localhost:8761/eureka/apps/FOO/localhost%3Afoo").Respond("application/json", "{}");

await using WebApplication app = builder.Build();

Expand All @@ -157,7 +159,8 @@ public async Task AddEurekaDiscoveryClient_uses_health_check_handler()
var infoManager = app.Services.GetRequiredService<EurekaApplicationInfoManager>();
infoManager.Instance.Status.Should().Be(InstanceStatus.Up);

handler.Mock.VerifyNoOutstandingExpectation();
handler.Mock.GetMatchCount(registerMock).Should().Be(1);
handler.Mock.GetMatchCount(heartbeatMock).Should().BeGreaterThan(0);
}

private sealed class TestHealthContributor : IHealthContributor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ public async Task<Dictionary<string, DbMigrationsDescriptor>> InvokeAsync(object
Type[] knownDbContextTypes = _scanner.AssemblyToScan
.GetReferencedAssemblies()
.Select(Assembly.Load)
.Where(assembly => Array.Exists(assembly.GetReferencedAssemblies(), reference => reference.Name == "Microsoft.EntityFrameworkCore" && !assembly
.GetName()
.Name!.StartsWith("Microsoft.EntityFrameworkCore", StringComparison.Ordinal)))
.SelectMany(assembly => assembly.DefinedTypes)
.Union(_scanner.AssemblyToScan.DefinedTypes)
.Where(type => !type.IsAbstract && type.AsType() != dbContextType && dbContextType.GetTypeInfo()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,11 @@ public async Task Can_resolve_source_location_from_pdb()
using var loggerFactory = new LoggerFactory([loggerProvider]);
ILogger<EventPipeThreadDumper> logger = loggerFactory.CreateLogger<EventPipeThreadDumper>();

#if NET8_0
// Use a longer collection window on .NET 8 to compensate for the Sleep(0) yield.
// Use a longer collection window to compensate for overloaded runners in CI.
var optionsMonitor = TestOptionsMonitor.Create(new ThreadDumpEndpointOptions
{
Duration = 100
});
#else
var optionsMonitor = new TestOptionsMonitor<ThreadDumpEndpointOptions>();
#endif

var dumper = new EventPipeThreadDumper(optionsMonitor, logger);

Expand Down Expand Up @@ -106,10 +102,8 @@ public static void BackgroundThreadCallback(object? argument)
{
// Only actively-running threads are shown in the thread dump, so we need to make sure the CPU is in use.
Thread.SpinWait(250);
#if NET8_0
// Yield to allow the EventPipe rundown thread to make progress on .NET 8.
// Yield to allow the EventPipe sampler/rundown thread to make progress on loaded CI runners.
Thread.Sleep(0);
#endif
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public async Task PeriodicRefreshCanBeTurnedOnAfterStart()
fileProvider.NotifyChanged();
await Task.Delay(500.Milliseconds(), TestContext.Current.CancellationToken);

handler.Mock.GetMatchCount(registerMock).Should().BeGreaterThan(2);
handler.Mock.GetMatchCount(registerMock).Should().BeGreaterThan(1);
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>@ViewData["Title"] - Steeltoe.Management.Endpoint.RazorPagesTestWebApp</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css" integrity="sha384-KyZXEAg3QhqLMpG8r+8fhAXLRk2vvoC2f3B09zVXn8CA5QIVfZOJ3BCsw2P0p/We" crossorigin="anonymous"/>
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true"/>
</head>
<body>
Expand Down
Loading