Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract Aspire.Hosting.AWS.Tests #5281

Merged
merged 6 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
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.AWS.Tests", "tests\Aspire.Hosting.AWS.Tests\Aspire.Hosting.AWS.Tests.csproj", "{6F71BC73-B703-4E64-98E0-801781302E7A}"
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
{6F71BC73-B703-4E64-98E0-801781302E7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6F71BC73-B703-4E64-98E0-801781302E7A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6F71BC73-B703-4E64-98E0-801781302E7A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6F71BC73-B703-4E64-98E0-801781302E7A}.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}
{6F71BC73-B703-4E64-98E0-801781302E7A} = {830A89EC-4029-4753-B25A-068BAE37DEC7}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6DCEDFEC-988E-4CB3-B45B-191EB5086E0C}
Expand Down
2 changes: 1 addition & 1 deletion src/Aspire.Hosting.AWS/Aspire.Hosting.AWS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="Aspire.Hosting.Tests" />
<InternalsVisibleTo Include="Aspire.Hosting.AWS.Tests" />
eerhardt marked this conversation as resolved.
Show resolved Hide resolved
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
using Aspire.Hosting.Utils;
using Xunit;

namespace Aspire.Hosting.Tests.AWS;
namespace Aspire.Hosting.AWS.Tests;

public class AWSCloudFormationResourceTests
{
[Fact]
Expand Down
39 changes: 39 additions & 0 deletions tests/Aspire.Hosting.AWS.Tests/AWSSchemaTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

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

namespace Aspire.Hosting.AWS.Tests;

public class AWSSchemaTests
{
[Fact]
public void ValidateAwsStackSamples()
radical marked this conversation as resolved.
Show resolved Hide resolved
{
new SchemaTests().ValidateApplicationSamples("AwsStack", (IDistributedApplicationBuilder builder) =>
{
sebastienros marked this conversation as resolved.
Show resolved Hide resolved
var awsSdkConfig = builder.AddAWSSDKConfig()
.WithRegion(RegionEndpoint.USWest2)
.WithProfile("test-profile");

builder.AddAWSCloudFormationStack("ExistingStack")
.WithReference(awsSdkConfig);
});
}

[Fact]
public void ValidateAwsTemplateSamples()
{
new SchemaTests().ValidateApplicationSamples("AwsTemplate", (IDistributedApplicationBuilder builder) =>
{
var awsSdkConfig = builder.AddAWSSDKConfig()
.WithRegion(RegionEndpoint.USWest2)
.WithProfile("test-profile");

builder.AddAWSCloudFormationTemplate("TemplateStack", "nonexistenttemplate")
.WithReference(awsSdkConfig);
});
}
}
12 changes: 12 additions & 0 deletions tests/Aspire.Hosting.AWS.Tests/Aspire.Hosting.AWS.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>$(NetCurrent)</TargetFramework>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Aspire.Hosting.AWS\Aspire.Hosting.AWS.csproj" IsAspireProjectResource="false" />
<ProjectReference Include="..\..\src\Aspire.Hosting.Testing\Aspire.Hosting.Testing.csproj" />
sebastienros marked this conversation as resolved.
Show resolved Hide resolved
<ProjectReference Include="..\Aspire.Hosting.Tests\Aspire.Hosting.Tests.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
using Aspire.Hosting.Utils;
using Xunit;

namespace Aspire.Hosting.Tests.AWS;
namespace Aspire.Hosting.AWS.Tests;

public class StackOutputReferenceTests
{
[Fact]
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 @@ -11,7 +11,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" />
Expand Down
23 changes: 0 additions & 23 deletions tests/Aspire.Hosting.Tests/Schema/SchemaTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System.Text.Json.Nodes;
using Amazon;
using Aspire.Hosting.Publishing;
using Aspire.Hosting.Tests.Helpers;
using Aspire.Hosting.Utils;
Expand Down Expand Up @@ -131,28 +130,6 @@ public static TheoryData<string, Action<IDistributedApplicationBuilder>> Applica
}
},

{ "AwsStack", (IDistributedApplicationBuilder builder) =>
{
var awsSdkConfig = builder.AddAWSSDKConfig()
.WithRegion(RegionEndpoint.USWest2)
.WithProfile("test-profile");

builder.AddAWSCloudFormationStack("ExistingStack")
.WithReference(awsSdkConfig);
}
},

{ "AwsTemplate", (IDistributedApplicationBuilder builder) =>
{
var awsSdkConfig = builder.AddAWSSDKConfig()
.WithRegion(RegionEndpoint.USWest2)
.WithProfile("test-profile");

builder.AddAWSCloudFormationTemplate("TemplateStack", "nonexistenttemplate")
.WithReference(awsSdkConfig);
}
},

{ "DaprWithComponents", (IDistributedApplicationBuilder builder) =>
{
var dapr = builder.AddDapr(dopts =>
Expand Down
Loading