Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Add seq to end to end tests #23

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
1 change: 1 addition & 0 deletions tests/Aspire.EndToEnd.Tests/IntegrationServicesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public IntegrationServicesTests(ITestOutputHelper testOutput, IntegrationService
[InlineData(TestResourceNames.rabbitmq)]
[InlineData(TestResourceNames.redis)]
[InlineData(TestResourceNames.sqlserver)]
[InlineData(TestResourceNames.seq)]
public Task VerifyComponentWorks(TestResourceNames resourceName)
=> RunTestAsync(async () =>
{
Expand Down
3 changes: 2 additions & 1 deletion tests/testproject/Common/TestResourceNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public enum TestResourceNames
redis = 1 << 9,
sqlserver = 1 << 10,
efnpgsql = 1 << 11,
All = cosmos | dashboard | kafka | mongodb | mysql | oracledatabase | efmysql | postgres | rabbitmq | redis | sqlserver | efnpgsql
seq = 1 << 12,
All = cosmos | dashboard | kafka | mongodb | mysql | oracledatabase | efmysql | postgres | rabbitmq | redis | sqlserver | efnpgsql | seq
}

public static class TestResourceNamesExtensions
Expand Down
5 changes: 5 additions & 0 deletions tests/testproject/TestProject.AppHost/TestProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ private TestProgram(string[] args, Assembly assembly, bool includeIntegrationSer
var cosmos = AppBuilder.AddAzureCosmosDB("cosmos").RunAsEmulator();
IntegrationServiceABuilder = IntegrationServiceABuilder.WithReference(cosmos);
}
if (!resourcesToSkip.HasFlag(TestResourceNames.seq))
{
var seq = AppBuilder.AddSeq("seq");
IntegrationServiceABuilder = IntegrationServiceABuilder.WithReference(seq);
}
}

AppBuilder.Services.AddLifecycleHook<EndPointWriterHook>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<ProjectReference Include="..\..\..\src\Aspire.Hosting.RabbitMQ\Aspire.Hosting.RabbitMQ.csproj" IsAspireProjectResource="false" />
<ProjectReference Include="..\..\..\src\Aspire.Hosting.Redis\Aspire.Hosting.Redis.csproj" IsAspireProjectResource="false" />
<ProjectReference Include="..\..\..\src\Aspire.Hosting.SqlServer\Aspire.Hosting.SqlServer.csproj" IsAspireProjectResource="false" />
<ProjectReference Include="..\..\..\src\Aspire.Hosting.Seq\Aspire.Hosting.Seq.csproj" IsAspireProjectResource="false" />
</ItemGroup>
<ItemGroup Condition="'$(TestsRunningOutsideOfRepo)' == 'true'">
<PackageReference Include="Aspire.Hosting.Azure" />
Expand All @@ -34,6 +35,7 @@
<PackageReference Include="Aspire.Hosting.RabbitMQ" />
<PackageReference Include="Aspire.Hosting.Redis" />
<PackageReference Include="Aspire.Hosting.SqlServer" />
<PackageReference Include="Aspire.Hosting.Seq" />
</ItemGroup>

<ItemGroup>
Expand Down
10 changes: 10 additions & 0 deletions tests/testproject/TestProject.IntegrationServiceA/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@
builder.AddAzureCosmosDBClient("cosmos");
}

if (!resourcesToSkip.HasFlag(TestResourceNames.seq))
{
builder.AddSeqEndpoint("seq");
}

// Ensure healthChecks are added. Some components like Cosmos
// don't add this
builder.Services.AddHealthChecks();
Expand Down Expand Up @@ -135,4 +140,9 @@
app.MapCosmosApi();
}

if (!resourcesToSkip.HasFlag(TestResourceNames.seq))
{
app.MapSeqApi();
}

app.Run();
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

public static class SeqExtensions
{
public static void MapSeqApi(this WebApplication app)
{
app.MapGet("/seq/verify", VerifySeqAsync);
}

private static Task<IResult> VerifySeqAsync()
{
return Task.FromResult(Results.Ok());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<ComponentReferenceForTests Include="Aspire.Pomelo.EntityFrameworkCore.MySql" />
<ComponentReferenceForTests Include="Aspire.RabbitMQ.Client" />
<ComponentReferenceForTests Include="Aspire.StackExchange.Redis" />
<ComponentReferenceForTests Include="Aspire.Seq" />
</ItemGroup>

<ItemGroup>
Expand Down