Skip to content

Commit 1f52231

Browse files
Alirexaasebastienroseerhardt
authored
Extract Aspire.Hosting.MongoDB.Tests project (#5017)
Co-authored-by: Sébastien Ros <[email protected]> Co-authored-by: Eric Erhardt <[email protected]>
1 parent 11ab6f8 commit 1f52231

File tree

15 files changed

+384
-112
lines changed

15 files changed

+384
-112
lines changed

Aspire.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.Hosting.Keycloak.Tes
541541
EndProject
542542
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}"
543543
EndProject
544+
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}"
545+
EndProject
544546
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}"
545547
EndProject
546548
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}"
@@ -1435,6 +1437,10 @@ Global
14351437
{48FF09E9-7D33-4A3F-9FF2-4C43A219C7B7}.Debug|Any CPU.Build.0 = Debug|Any CPU
14361438
{48FF09E9-7D33-4A3F-9FF2-4C43A219C7B7}.Release|Any CPU.ActiveCfg = Release|Any CPU
14371439
{48FF09E9-7D33-4A3F-9FF2-4C43A219C7B7}.Release|Any CPU.Build.0 = Release|Any CPU
1440+
{DD9BC533-8072-481C-9A7E-F95DC36B34C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1441+
{DD9BC533-8072-481C-9A7E-F95DC36B34C0}.Debug|Any CPU.Build.0 = Debug|Any CPU
1442+
{DD9BC533-8072-481C-9A7E-F95DC36B34C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
1443+
{DD9BC533-8072-481C-9A7E-F95DC36B34C0}.Release|Any CPU.Build.0 = Release|Any CPU
14381444
{F492357C-682E-4CBB-A374-1A124B3976A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
14391445
{F492357C-682E-4CBB-A374-1A124B3976A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
14401446
{F492357C-682E-4CBB-A374-1A124B3976A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -1727,6 +1733,7 @@ Global
17271733
{C556D61C-7E11-43EC-9098-C8D170FEA905} = {EBC55A17-B0D6-4E0A-9DC2-7D264E96F631}
17281734
{5867BAF2-FEF0-4661-BFDE-9ADCDC2921CD} = {830A89EC-4029-4753-B25A-068BAE37DEC7}
17291735
{48FF09E9-7D33-4A3F-9FF2-4C43A219C7B7} = {C424395C-1235-41A4-BF55-07880A04368C}
1736+
{DD9BC533-8072-481C-9A7E-F95DC36B34C0} = {830A89EC-4029-4753-B25A-068BAE37DEC7}
17301737
{F492357C-682E-4CBB-A374-1A124B3976A3} = {830A89EC-4029-4753-B25A-068BAE37DEC7}
17311738
{8691F993-7B19-496E-B8E1-EF1199ACF2E1} = {830A89EC-4029-4753-B25A-068BAE37DEC7}
17321739
{DB3E1AD8-87F6-414D-B46F-A0DC334AECCD} = {A68BA1A5-1604-433D-9778-DC0199831C2A}

tests/Aspire.EndToEnd.Tests/IntegrationServicesFixture.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ public Task DumpComponentLogsAsync(TestResourceNames resource, ITestOutputHelper
104104
{
105105
TestResourceNames.cosmos or TestResourceNames.efcosmos => "cosmos",
106106
TestResourceNames.eventhubs => "eventhubs",
107-
TestResourceNames.mongodb => "mongodb",
108107
TestResourceNames.oracledatabase => "oracledatabase",
109108
TestResourceNames.postgres or TestResourceNames.efnpgsql => "postgres",
110109
TestResourceNames.redis => "redis",
@@ -141,8 +140,7 @@ private static TestResourceNames GetResourcesToSkip()
141140
"oracle" => TestResourceNames.oracledatabase,
142141
"cosmos" => TestResourceNames.cosmos | TestResourceNames.efcosmos,
143142
"eventhubs" => TestResourceNames.eventhubs,
144-
"basicservices" => TestResourceNames.mongodb
145-
| TestResourceNames.redis
143+
"basicservices" => TestResourceNames.redis
146144
| TestResourceNames.postgres
147145
| TestResourceNames.efnpgsql
148146
| TestResourceNames.sqlserver

tests/Aspire.EndToEnd.Tests/IntegrationServicesTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public IntegrationServicesTests(ITestOutputHelper testOutput, IntegrationService
2323

2424
[Theory]
2525
[Trait("scenario", "basicservices")]
26-
[InlineData(TestResourceNames.mongodb)]
2726
[InlineData(TestResourceNames.postgres)]
2827
[InlineData(TestResourceNames.efnpgsql)]
2928
[InlineData(TestResourceNames.redis)]

tests/Aspire.Hosting.Tests/MongoDB/AddMongoDBTests.cs renamed to tests/Aspire.Hosting.MongoDB.Tests/AddMongoDBTests.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using System.Net.Sockets;
5-
using Aspire.Hosting.MongoDB;
5+
using Aspire.Hosting.ApplicationModel;
66
using Aspire.Hosting.Tests.Utils;
77
using Aspire.Hosting.Utils;
88
using Microsoft.Extensions.DependencyInjection;
99
using Xunit;
1010

11-
namespace Aspire.Hosting.Tests.MongoDB;
11+
namespace Aspire.Hosting.MongoDB.Tests;
1212

1313
public class AddMongoDBTests
1414
{
@@ -108,7 +108,8 @@ public void WithMongoExpressAddsContainer()
108108
public void WithMongoExpressSupportsChangingContainerImageValues()
109109
{
110110
var builder = DistributedApplication.CreateBuilder();
111-
builder.AddMongoDB("mongo").WithMongoExpress(c => {
111+
builder.AddMongoDB("mongo").WithMongoExpress(c =>
112+
{
112113
c.WithImageRegistry("example.mycompany.com");
113114
c.WithImage("customongoexpresscontainer");
114115
c.WithImageTag("someothertag");
@@ -125,7 +126,8 @@ public void WithMongoExpressSupportsChangingContainerImageValues()
125126
public void WithMongoExpressSupportsChangingHostPort()
126127
{
127128
var builder = DistributedApplication.CreateBuilder();
128-
builder.AddMongoDB("mongo").WithMongoExpress(c => {
129+
builder.AddMongoDB("mongo").WithMongoExpress(c =>
130+
{
129131
c.WithHostPort(1000);
130132
});
131133

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>$(NetCurrent)</TargetFramework>
5+
<NoWarn>$(NoWarn);CS8002</NoWarn> <!-- MongoDB packages are not signed -->
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<ProjectReference Include="..\..\src\Aspire.Hosting.MongoDB\Aspire.Hosting.MongoDB.csproj" />
10+
<ProjectReference Include="..\..\src\Components\Aspire.MongoDB.Driver\Aspire.MongoDB.Driver.csproj" />
11+
<ProjectReference Include="..\Aspire.Hosting.Tests\Aspire.Hosting.Tests.csproj" />
12+
13+
<PackageReference Include="Microsoft.Extensions.Http.Resilience" />
14+
</ItemGroup>
15+
16+
<ItemGroup>
17+
<Compile Include="$(RepoRoot)src\Aspire.Hosting.MongoDB\MongoDBContainerImageTags.cs" />
18+
<Compile Include="$(SharedDir)VolumeNameGenerator.cs" Link="Utils\VolumeNameGenerator.cs" />
19+
<Compile Include="$(RepoRoot)src\Aspire.Hosting.Testing\ResourceLoggerForwarderService.cs" Link="Utils\ResourceLoggerForwarderService.cs" />
20+
</ItemGroup>
21+
22+
</Project>

0 commit comments

Comments
 (0)