Skip to content
39 changes: 23 additions & 16 deletions Aspire.sln
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Servic
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OracleEndToEnd", "OracleEndToEnd", "{16F4BE51-EEC1-4C72-9148-5289F4BBA38C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OracleEndToEnd.AppHost", "playground\OracleEndToEnd\OracleEndToEnd.AppHost\OracleEndToEnd.AppHost.csproj", "{8AC2375F-89F4-4E20-BF2E-F243AB1B2A10}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OracleEndToEnd.AppHost", "playground\OracleEndToEnd\OracleEndToEnd.AppHost\OracleEndToEnd.AppHost.csproj", "{8AC2375F-89F4-4E20-BF2E-F243AB1B2A10}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OracleEndToEnd.ApiService", "playground\OracleEndToEnd\OracleEndToEnd.ApiService\OracleEndToEnd.ApiService.csproj", "{834119AA-9745-4414-88A7-C3677808F97F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OracleEndToEnd.ApiService", "playground\OracleEndToEnd\OracleEndToEnd.ApiService\OracleEndToEnd.ApiService.csproj", "{834119AA-9745-4414-88A7-C3677808F97F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "kafka", "kafka", "{920BB263-E68F-4FA2-93FC-2E385EEA405B}"
EndProject
Expand Down Expand Up @@ -507,7 +507,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "python", "python", "{7123AB
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Python.AppHost", "playground\python\Python.AppHost\Python.AppHost.csproj", "{173BDA6E-F175-4457-BF64-58CD184E9A81}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspire.Playground.Tests", "tests\Aspire.Playground.Tests\Aspire.Playground.Tests.csproj", "{8C07B9BF-87F4-450D-92FA-E03CF763013B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.Playground.Tests", "tests\Aspire.Playground.Tests\Aspire.Playground.Tests.csproj", "{8C07B9BF-87F4-450D-92FA-E03CF763013B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.Hosting.Elasticsearch.Tests", "tests\Aspire.Hosting.Elasticsearch.Tests\Aspire.Hosting.Elasticsearch.Tests.csproj", "{62D8C73C-DAB3-4B9E-A508-34C886C374F9}"
EndProject
Expand All @@ -517,7 +517,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Hosting", "Hosting", "{830A
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.Hosting.Redis.Tests", "tests\Aspire.Hosting.Redis.Tests\Aspire.Hosting.Redis.Tests.csproj", "{1BC02557-B78B-48CE-9D3C-488A6B7672F4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspire.Hosting.Garnet.Tests", "tests\Aspire.Hosting.Garnet.Tests\Aspire.Hosting.Garnet.Tests.csproj", "{CAA4A93F-6BEB-42EB-8680-C1CF72928023}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.Hosting.Garnet.Tests", "tests\Aspire.Hosting.Garnet.Tests\Aspire.Hosting.Garnet.Tests.csproj", "{CAA4A93F-6BEB-42EB-8680-C1CF72928023}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.Hosting.PostgreSQL.Tests", "tests\Aspire.Hosting.PostgreSQL.Tests\Aspire.Hosting.PostgreSQL.Tests.csproj", "{7425E5B2-BC47-4521-AC40-B8CECA329E08}"
EndProject
Expand Down Expand Up @@ -549,33 +549,35 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.Hosting.Keycloak.Tes
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.Keycloak.Authentication.Tests", "tests\Aspire.Keycloak.Authentication.Tests\Aspire.Keycloak.Authentication.Tests.csproj", "{48FF09E9-7D33-4A3F-9FF2-4C43A219C7B7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspire.Hosting.MongoDB.Tests", "tests\Aspire.Hosting.MongoDB.Tests\Aspire.Hosting.MongoDB.Tests.csproj", "{DD9BC533-8072-481C-9A7E-F95DC36B34C0}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.Hosting.MongoDB.Tests", "tests\Aspire.Hosting.MongoDB.Tests\Aspire.Hosting.MongoDB.Tests.csproj", "{DD9BC533-8072-481C-9A7E-F95DC36B34C0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspire.Hosting.Nats.Tests", "tests\Aspire.Hosting.Nats.Tests\Aspire.Hosting.Nats.Tests.csproj", "{F492357C-682E-4CBB-A374-1A124B3976A3}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.Hosting.Nats.Tests", "tests\Aspire.Hosting.Nats.Tests\Aspire.Hosting.Nats.Tests.csproj", "{F492357C-682E-4CBB-A374-1A124B3976A3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspire.Hosting.SqlServer.Tests", "tests\Aspire.Hosting.SqlServer.Tests\Aspire.Hosting.SqlServer.Tests.csproj", "{D705FE42-CD54-4575-BA18-0431256B40B2}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.Hosting.SqlServer.Tests", "tests\Aspire.Hosting.SqlServer.Tests\Aspire.Hosting.SqlServer.Tests.csproj", "{D705FE42-CD54-4575-BA18-0431256B40B2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.Hosting.Azure.Tests", "tests\Aspire.Hosting.Azure.Tests\Aspire.Hosting.Azure.Tests.csproj", "{8691F993-7B19-496E-B8E1-EF1199ACF2E1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestShop.AppHost", "playground\TestShop\TestShop.AppHost\TestShop.AppHost.csproj", "{DB3E1AD8-87F6-414D-B46F-A0DC334AECCD}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestShop.AppHost", "playground\TestShop\TestShop.AppHost\TestShop.AppHost.csproj", "{DB3E1AD8-87F6-414D-B46F-A0DC334AECCD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Dapr.AppHost", "playground\dapr\Dapr.AppHost\Dapr.AppHost.csproj", "{D537CF4D-DF30-41C7-B4F9-FEB152A19BE7}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Dapr.AppHost", "playground\dapr\Dapr.AppHost\Dapr.AppHost.csproj", "{D537CF4D-DF30-41C7-B4F9-FEB152A19BE7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orleans.AppHost", "playground\orleans\Orleans.AppHost\Orleans.AppHost.csproj", "{355F724F-D24F-45C6-8914-574385F6FC89}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Orleans.AppHost", "playground\orleans\Orleans.AppHost\Orleans.AppHost.csproj", "{355F724F-D24F-45C6-8914-574385F6FC89}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SignalR.AppHost", "playground\signalr\SignalR.AppHost\SignalR.AppHost.csproj", "{F1D00709-50F2-4533-B38F-3517C0EDEAEE}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SignalR.AppHost", "playground\signalr\SignalR.AppHost\SignalR.AppHost.csproj", "{F1D00709-50F2-4533-B38F-3517C0EDEAEE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebPubSub.AppHost", "playground\webpubsub\WebPubSub.AppHost\WebPubSub.AppHost.csproj", "{1419BDCB-47EB-43EB-9149-C935B7208A72}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebPubSub.AppHost", "playground\webpubsub\WebPubSub.AppHost\WebPubSub.AppHost.csproj", "{1419BDCB-47EB-43EB-9149-C935B7208A72}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspire.Hosting.NodeJs.Tests", "tests\Aspire.Hosting.NodeJs.Tests\Aspire.Hosting.NodeJs.Tests.csproj", "{50450FBB-CD10-4281-B22C-7FF86CEE9D9F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.Hosting.NodeJs.Tests", "tests\Aspire.Hosting.NodeJs.Tests\Aspire.Hosting.NodeJs.Tests.csproj", "{50450FBB-CD10-4281-B22C-7FF86CEE9D9F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspire.Hosting.RabbitMQ.Tests", "tests\Aspire.Hosting.RabbitMQ.Tests\Aspire.Hosting.RabbitMQ.Tests.csproj", "{872AC635-B880-4FAC-BB43-4FD97D7B1209}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.Hosting.RabbitMQ.Tests", "tests\Aspire.Hosting.RabbitMQ.Tests\Aspire.Hosting.RabbitMQ.Tests.csproj", "{872AC635-B880-4FAC-BB43-4FD97D7B1209}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BrowserTelemetry", "BrowserTelemetry", "{15966C27-17FA-4A46-A172-55985411540A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BrowserTelemetry.AppHost", "playground\BrowserTelemetry\BrowserTelemetry.AppHost\BrowserTelemetry.AppHost.csproj", "{29946391-F2E9-4DEA-92A2-6FAAC1508446}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BrowserTelemetry.AppHost", "playground\BrowserTelemetry\BrowserTelemetry.AppHost\BrowserTelemetry.AppHost.csproj", "{29946391-F2E9-4DEA-92A2-6FAAC1508446}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BrowserTelemetry.Web", "playground\BrowserTelemetry\BrowserTelemetry.Web\BrowserTelemetry.Web.csproj", "{091EA540-355B-4763-9980-5F83F0BB6F11}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BrowserTelemetry.Web", "playground\BrowserTelemetry\BrowserTelemetry.Web\BrowserTelemetry.Web.csproj", "{091EA540-355B-4763-9980-5F83F0BB6F11}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aspire.Hosting.Dapr.Tests", "tests\Aspire.Hosting.Dapr.Tests\Aspire.Hosting.Dapr.Tests.csproj", "{C60C5CFA-5B6D-4432-BFCD-54D1BEEC7DBE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -1519,6 +1521,10 @@ Global
{091EA540-355B-4763-9980-5F83F0BB6F11}.Debug|Any CPU.Build.0 = Debug|Any CPU
{091EA540-355B-4763-9980-5F83F0BB6F11}.Release|Any CPU.ActiveCfg = Release|Any CPU
{091EA540-355B-4763-9980-5F83F0BB6F11}.Release|Any CPU.Build.0 = Release|Any CPU
{C60C5CFA-5B6D-4432-BFCD-54D1BEEC7DBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C60C5CFA-5B6D-4432-BFCD-54D1BEEC7DBE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C60C5CFA-5B6D-4432-BFCD-54D1BEEC7DBE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C60C5CFA-5B6D-4432-BFCD-54D1BEEC7DBE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1797,6 +1803,7 @@ Global
{15966C27-17FA-4A46-A172-55985411540A} = {D173887B-AF42-4576-B9C1-96B9E9B3D9C0}
{29946391-F2E9-4DEA-92A2-6FAAC1508446} = {15966C27-17FA-4A46-A172-55985411540A}
{091EA540-355B-4763-9980-5F83F0BB6F11} = {15966C27-17FA-4A46-A172-55985411540A}
{C60C5CFA-5B6D-4432-BFCD-54D1BEEC7DBE} = {830A89EC-4029-4753-B25A-068BAE37DEC7}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6DCEDFEC-988E-4CB3-B45B-191EB5086E0C}
Expand Down
1 change: 1 addition & 0 deletions src/Aspire.Hosting/Aspire.Hosting.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
<ItemGroup>
<InternalsVisibleTo Include="Aspire.Hosting.Tests" />
<InternalsVisibleTo Include="Aspire.Hosting.Containers.Tests" />
<InternalsVisibleTo Include="Aspire.Hosting.Dapr.Tests" />
Copy link
Member

@eerhardt eerhardt Aug 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to change this. We shouldn't be using internals in these tests outside of our core tests. What is this needed for?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

await app.ExecuteBeforeStartHooksAsync(default); in DaprTests

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we refactor the tests to not need to use an internal API?

Copy link
Member Author

@sebastienros sebastienros Aug 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using UnsafeAccessor instead. It also works if part of this internal method is copied over, but I feel it's more brittle.

</ItemGroup>

</Project>
13 changes: 13 additions & 0 deletions tests/Aspire.Hosting.Dapr.Tests/Aspire.Hosting.Dapr.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>$(NetCurrent)</TargetFramework>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Aspire.Hosting.Dapr\Aspire.Hosting.Dapr.csproj" />
<ProjectReference Include="..\..\src\Aspire.Hosting.Testing\Aspire.Hosting.Testing.csproj" />
<ProjectReference Include="..\Aspire.Hosting.Tests\Aspire.Hosting.Tests.csproj" />
</ItemGroup>

</Project>
30 changes: 30 additions & 0 deletions tests/Aspire.Hosting.Dapr.Tests/DaprSchemaTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Aspire.Hosting.Tests.Schema;
using Xunit;

namespace Aspire.Hosting.Dapr.Tests;

public class DaprSchemaTests
{
[Fact]
public void ValidateWithDaprManifest()
{
new SchemaTests().ValidateApplicationSamples("DaprWithComponents", (IDistributedApplicationBuilder builder) =>
{
var dapr = builder.AddDapr(dopts =>
{
// Just to avoid dynamic discovery which will throw.
dopts.DaprPath = "notrealpath";
});
var state = dapr.AddDaprStateStore("daprstate");
var pubsub = dapr.AddDaprPubSub("daprpubsub");

builder.AddProject<Projects.ServiceA>("project")
.WithDaprSidecar()
.WithReference(state)
.WithReference(pubsub);
});
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Aspire.Hosting.Dapr;
using Aspire.Hosting.ApplicationModel;
using Aspire.Hosting.Tests.Utils;
using Aspire.Hosting.Utils;
using Microsoft.Extensions.DependencyInjection;
using Xunit;

namespace Aspire.Hosting.Tests.Dapr;
namespace Aspire.Hosting.Dapr.Tests;

public class DaprTests
{
Expand Down
1 change: 0 additions & 1 deletion tests/Aspire.Hosting.Tests/Aspire.Hosting.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<ItemGroup>
<ProjectReference Include="..\..\src\Aspire.Hosting.AppHost\Aspire.Hosting.AppHost.csproj" IsAspireProjectResource="false" />
<ProjectReference Include="..\..\src\Aspire.Hosting.AWS\Aspire.Hosting.AWS.csproj" IsAspireProjectResource="false" />
<ProjectReference Include="..\..\src\Aspire.Hosting.Dapr\Aspire.Hosting.Dapr.csproj" IsAspireProjectResource="false" />
<ProjectReference Include="..\..\src\Aspire.Hosting.NodeJs\Aspire.Hosting.NodeJs.csproj" IsAspireProjectResource="false" />
<ProjectReference Include="..\..\src\Aspire.Hosting.Testing\Aspire.Hosting.Testing.csproj" IsAspireProjectResource="false" />
<ProjectReference Include="..\Aspire.Components.Common.Tests\Aspire.Components.Common.Tests.csproj" IsAspireProjectResource="false" />
Expand Down
17 changes: 0 additions & 17 deletions tests/Aspire.Hosting.Tests/Schema/SchemaTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,23 +151,6 @@ public static TheoryData<string, Action<IDistributedApplicationBuilder>> Applica
builder.AddAWSCloudFormationTemplate("TemplateStack", "nonexistenttemplate")
.WithReference(awsSdkConfig);
}
},

{ "DaprWithComponents", (IDistributedApplicationBuilder builder) =>
{
var dapr = builder.AddDapr(dopts =>
{
// Just to avoid dynamic discovery which will throw.
dopts.DaprPath = "notrealpath";
});
var state = dapr.AddDaprStateStore("daprstate");
var pubsub = dapr.AddDaprPubSub("daprpubsub");

builder.AddProject<Projects.ServiceA>("project")
.WithDaprSidecar()
.WithReference(state)
.WithReference(pubsub);
}
}
};

Expand Down