Skip to content

Commit 4892f5f

Browse files
committed
Update to Aspire 9
1 parent 1247d57 commit 4892f5f

32 files changed

+52
-48
lines changed

src/Exceptionless.AppHost/Exceptionless.AppHost.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<Sdk Name="Aspire.AppHost.Sdk" Version="9.0.0-rc.1.24511.1" />
3+
<Sdk Name="Aspire.AppHost.Sdk" Version="9.0.0" />
44

55
<PropertyGroup>
66
<OutputType>Exe</OutputType>
@@ -12,9 +12,9 @@
1212
</PropertyGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="Aspire.Hosting.AppHost" Version="9.0.0-rc.1.24511.1" />
16-
<PackageReference Include="Aspire.Hosting.NodeJs" Version="9.0.0-rc.1.24511.1" />
17-
<PackageReference Include="Aspire.Hosting.Redis" Version="9.0.0-rc.1.24511.1" />
15+
<PackageReference Include="Aspire.Hosting.AppHost" Version="9.0.0" />
16+
<PackageReference Include="Aspire.Hosting.NodeJs" Version="9.0.0" />
17+
<PackageReference Include="Aspire.Hosting.Redis" Version="9.0.0" />
1818
<PackageReference Include="AspNetCore.HealthChecks.Elasticsearch" Version="8.0.1" />
1919
</ItemGroup>
2020

src/Exceptionless.AppHost/Program.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
.WithEndpoint(8025, 8025, "http")
2121
.WithEndpoint(1025, 1025);
2222

23-
var job = builder.AddProject<Projects.Exceptionless_Job>("Jobs", "AllJobs")
23+
builder.AddProject<Projects.Exceptionless_Job>("Jobs", "AllJobs")
2424
.WithReference(cache)
2525
.WithReference(elastic)
2626
.WithEnvironment("ConnectionStrings:Email", "smtp://localhost:1025")
@@ -39,12 +39,12 @@
3939
.WaitFor(mail)
4040
.WithHttpHealthCheck("/health");
4141

42-
//builder.AddNpmApp("Web", "../../src/Exceptionless.Web/ClientApp", "dev")
43-
// .WithReference(api)
44-
// .WithEndpoint(scheme: "http", env: "PORT");
42+
builder.AddNpmApp("Web", "../../src/Exceptionless.Web/ClientApp", "dev")
43+
.WithReference(api)
44+
.WithEndpoint(scheme: "http", env: "PORT");
4545

46-
//builder.AddNpmApp("AngularWeb", "../../src/Exceptionless.Web/ClientApp.angular", "serve")
47-
// .WithReference(api)
48-
// .WithEndpoint(scheme: "http", env: "PORT");
46+
builder.AddNpmApp("AngularWeb", "../../src/Exceptionless.Web/ClientApp.angular", "serve")
47+
.WithReference(api)
48+
.WithEndpoint(scheme: "http", env: "PORT");
4949

5050
builder.Build().Run();

tests/Exceptionless.Tests/AppWebHostFactory.cs renamed to tests/Exceptionless.Tests/AspireWebHostFactory.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Aspire.Hosting;
2+
using Aspire.Hosting.ApplicationModel;
23
using Aspire.Hosting.Testing;
34
using Exceptionless.Insulation.Configuration;
45
using Exceptionless.Web;
@@ -8,26 +9,29 @@
89

910
namespace Exceptionless.Tests;
1011

11-
public class AppWebHostFactory : WebApplicationFactory<Startup>, IAsyncLifetime
12+
public class AspireWebHostFactory : WebApplicationFactory<Startup>, IAsyncLifetime
1213
{
1314
private DistributedApplication? _app;
1415

1516
public DistributedApplication App => _app ?? throw new InvalidOperationException("The application is not initialized");
1617

1718
public string? ElasticsearchConnectionString { get; private set; }
1819
public string? RedisConnectionString { get; private set; }
19-
public string? MailConnectionString { get; private set; }
2020

2121
public async Task InitializeAsync()
2222
{
2323
var options = new DistributedApplicationOptions { AssemblyName = typeof(ElasticsearchResource).Assembly.FullName, DisableDashboard = true };
2424
var builder = DistributedApplication.CreateBuilder(options);
2525

26-
var elastic = builder.AddElasticsearch("Elasticsearch")
27-
.WithContainerName("Exceptionless-Elasticsearch-Test");
26+
builder.AddElasticsearch("Elasticsearch")
27+
.WithContainerName("Exceptionless-Elasticsearch-Test")
28+
.WithImageTag("8.15.2")
29+
.WithLifetime(ContainerLifetime.Persistent);
2830

29-
var cache = builder.AddRedis("Redis")
30-
.WithContainerName("Exceptionless-Redis-Test");
31+
builder.AddRedis("Redis")
32+
.WithContainerName("Exceptionless-Redis-Test")
33+
.WithImageTag("7.4")
34+
.WithLifetime(ContainerLifetime.Persistent);;
3135

3236
_app = builder.Build();
3337

tests/Exceptionless.Tests/Controllers/AuthControllerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class AuthControllerTests : IntegrationTestsBase
2727
private readonly IOrganizationRepository _organizationRepository;
2828
private readonly ITokenRepository _tokenRepository;
2929

30-
public AuthControllerTests(ITestOutputHelper output, AppWebHostFactory factory) : base(output, factory)
30+
public AuthControllerTests(ITestOutputHelper output, AspireWebHostFactory factory) : base(output, factory)
3131
{
3232
_authOptions = GetService<AuthOptions>();
3333
_authOptions.EnableAccountCreation = true;

tests/Exceptionless.Tests/Controllers/EventControllerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class EventControllerTests : IntegrationTestsBase
4343
private readonly IQueue<EventUserDescription> _eventUserDescriptionQueue;
4444
private readonly UserData _userData;
4545

46-
public EventControllerTests(ITestOutputHelper output, AppWebHostFactory factory) : base(output, factory)
46+
public EventControllerTests(ITestOutputHelper output, AspireWebHostFactory factory) : base(output, factory)
4747
{
4848
_organizationRepository = GetService<IOrganizationRepository>();
4949
_stackData = GetService<StackData>();

tests/Exceptionless.Tests/Controllers/ProjectControllerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace Exceptionless.Tests.Controllers;
1313

1414
public sealed class ProjectControllerTests : IntegrationTestsBase
1515
{
16-
public ProjectControllerTests(ITestOutputHelper output, AppWebHostFactory factory) : base(output, factory)
16+
public ProjectControllerTests(ITestOutputHelper output, AspireWebHostFactory factory) : base(output, factory)
1717
{
1818
}
1919

tests/Exceptionless.Tests/Controllers/StackControllerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class StackControllerTests : IntegrationTestsBase
2121
private readonly IQueue<EventPost> _eventQueue;
2222
private readonly IQueue<WorkItemData> _workItemQueue;
2323

24-
public StackControllerTests(ITestOutputHelper output, AppWebHostFactory factory) : base(output, factory)
24+
public StackControllerTests(ITestOutputHelper output, AspireWebHostFactory factory) : base(output, factory)
2525
{
2626
_stackRepository = GetService<IStackRepository>();
2727
_eventRepository = GetService<IEventRepository>();

tests/Exceptionless.Tests/Controllers/StatusControllerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace Exceptionless.Tests.Controllers;
1010

1111
public class StatusControllerTests : IntegrationTestsBase
1212
{
13-
public StatusControllerTests(ITestOutputHelper output, AppWebHostFactory factory) : base(output, factory)
13+
public StatusControllerTests(ITestOutputHelper output, AspireWebHostFactory factory) : base(output, factory)
1414
{
1515
}
1616

tests/Exceptionless.Tests/Controllers/TokenControllerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace Exceptionless.Tests.Controllers;
1414

1515
public sealed class TokenControllerTests : IntegrationTestsBase
1616
{
17-
public TokenControllerTests(ITestOutputHelper output, AppWebHostFactory factory) : base(output, factory) { }
17+
public TokenControllerTests(ITestOutputHelper output, AspireWebHostFactory factory) : base(output, factory) { }
1818

1919
protected override async Task ResetDataAsync()
2020
{

tests/Exceptionless.Tests/Controllers/WebHookControllerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace Exceptionless.Tests.Controllers;
1010

1111
public sealed class WebHookControllerTests : IntegrationTestsBase
1212
{
13-
public WebHookControllerTests(ITestOutputHelper output, AppWebHostFactory factory) : base(output, factory) { }
13+
public WebHookControllerTests(ITestOutputHelper output, AspireWebHostFactory factory) : base(output, factory) { }
1414

1515
protected override async Task ResetDataAsync()
1616
{

0 commit comments

Comments
 (0)