Skip to content
Merged
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
8 changes: 6 additions & 2 deletions tests/TUnit.Aspire.Tests/CrashedExecutableLogTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections.Concurrent;
using Aspire.Hosting;
using Aspire.Hosting.ApplicationModel;
using Aspire.Hosting.Testing;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Diagnostics.HealthChecks;
Expand Down Expand Up @@ -79,8 +80,8 @@ public sealed class CrashingProbeFixture(bool retain) : AspireFixture<Projects.T
ResourceLogNames = [ProbeName],
};

// Only the crashing executable: no Docker container and no project build needed.
protected override IEnumerable<string> ResourcesToRemove() => ["nginx-no-healthcheck", "api-service"];
// Only the crashing executable: no Docker container, project build, or unresolved parameter.
protected override IEnumerable<string> ResourcesToRemove() => ["nginx-no-healthcheck", "api-service", "my-secret"];

protected override void ConfigureBuilder(IDistributedApplicationTestingBuilder builder)
{
Expand All @@ -89,6 +90,9 @@ protected override void ConfigureBuilder(IDistributedApplicationTestingBuilder b
builder.Services.AddHealthChecks().AddCheck("probe-never-healthy", () => HealthCheckResult.Unhealthy());

builder.AddExecutable(ProbeName, "dotnet", Environment.CurrentDirectory, "--" + ProbeMarker)
// This process makes no TLS connections. Avoid certificate preparation before DCP
// launches it, so the startup timeout measures the crashing process rather than TLS setup.
.WithCertificateTrustScope(CertificateTrustScope.None)
.WithHealthCheck("probe-never-healthy");
}

Expand Down
Loading