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.MongoDB.Tests project #5017

Merged
merged 24 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
2cbbdca
Extract Aspire.Hosting.MongoDB.Tests project
Alirexaa Jul 22, 2024
1bf75cc
Merge branch 'main' into mongodb-tests
Alirexaa Jul 22, 2024
8c48447
Merge branch 'main' into mongodb-tests
sebastienros Jul 25, 2024
1bbf7b3
Add VerifyWithInitBindMount test
sebastienros Jul 25, 2024
a6b8a9a
Remove Mongo from E2E tests
sebastienros Jul 25, 2024
2643c28
Increase timeout
sebastienros Jul 25, 2024
1bb1ef4
Apply suggestions from code review
Alirexaa Jul 31, 2024
32d88df
Merge branch 'main' into mongodb-tests
Alirexaa Jul 31, 2024
723bad3
Update IntegrationServicesFixture.cs
Alirexaa Jul 31, 2024
d7b8153
fix merge
Alirexaa Aug 1, 2024
bff2589
set permission to init file maybe test works on linux
Alirexaa Aug 1, 2024
e5c2fff
first try
Alirexaa Aug 1, 2024
39d3e0b
Merge branch 'main' into mongodb-tests
Alirexaa Aug 1, 2024
77046fa
Add ResourceLoggerForwarderService to builder
Alirexaa Aug 1, 2024
c257098
Merge branch 'mongodb-tests' of https://github.com/Alirexaa/aspire in…
Alirexaa Aug 1, 2024
e9b1aff
tiny fix maybe this time works
Alirexaa Aug 1, 2024
a75ebf6
Merge branch 'main' of https://github.com/dotnet/aspire into mongodb-…
Alirexaa Aug 2, 2024
1ebadfa
Merge branch 'main' into mongodb-tests
sebastienros Aug 5, 2024
2889b12
Disable mount init test on CI
sebastienros Aug 5, 2024
175fd06
Test init script on CI
sebastienros Aug 5, 2024
479bcb9
Add comment
sebastienros Aug 5, 2024
9069567
Use SetUnixFileMode instead of chmod
sebastienros Aug 6, 2024
ac90547
Address PR feedback
eerhardt Aug 6, 2024
63b6033
Fix build - add back NoWarn on CS8002
eerhardt Aug 6, 2024
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
7 changes: 7 additions & 0 deletions Aspire.sln
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,8 @@ 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}"
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}"
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}"
Expand Down Expand Up @@ -1435,6 +1437,10 @@ Global
{48FF09E9-7D33-4A3F-9FF2-4C43A219C7B7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{48FF09E9-7D33-4A3F-9FF2-4C43A219C7B7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{48FF09E9-7D33-4A3F-9FF2-4C43A219C7B7}.Release|Any CPU.Build.0 = Release|Any CPU
{DD9BC533-8072-481C-9A7E-F95DC36B34C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DD9BC533-8072-481C-9A7E-F95DC36B34C0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DD9BC533-8072-481C-9A7E-F95DC36B34C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DD9BC533-8072-481C-9A7E-F95DC36B34C0}.Release|Any CPU.Build.0 = Release|Any CPU
{F492357C-682E-4CBB-A374-1A124B3976A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F492357C-682E-4CBB-A374-1A124B3976A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F492357C-682E-4CBB-A374-1A124B3976A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -1727,6 +1733,7 @@ Global
{C556D61C-7E11-43EC-9098-C8D170FEA905} = {EBC55A17-B0D6-4E0A-9DC2-7D264E96F631}
{5867BAF2-FEF0-4661-BFDE-9ADCDC2921CD} = {830A89EC-4029-4753-B25A-068BAE37DEC7}
{48FF09E9-7D33-4A3F-9FF2-4C43A219C7B7} = {C424395C-1235-41A4-BF55-07880A04368C}
{DD9BC533-8072-481C-9A7E-F95DC36B34C0} = {830A89EC-4029-4753-B25A-068BAE37DEC7}
{F492357C-682E-4CBB-A374-1A124B3976A3} = {830A89EC-4029-4753-B25A-068BAE37DEC7}
{8691F993-7B19-496E-B8E1-EF1199ACF2E1} = {830A89EC-4029-4753-B25A-068BAE37DEC7}
{DB3E1AD8-87F6-414D-B46F-A0DC334AECCD} = {A68BA1A5-1604-433D-9778-DC0199831C2A}
Expand Down
4 changes: 1 addition & 3 deletions tests/Aspire.EndToEnd.Tests/IntegrationServicesFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ public Task DumpComponentLogsAsync(TestResourceNames resource, ITestOutputHelper
{
TestResourceNames.cosmos or TestResourceNames.efcosmos => "cosmos",
TestResourceNames.eventhubs => "eventhubs",
TestResourceNames.mongodb => "mongodb",
TestResourceNames.oracledatabase => "oracledatabase",
TestResourceNames.postgres or TestResourceNames.efnpgsql => "postgres",
TestResourceNames.redis => "redis",
Expand Down Expand Up @@ -141,8 +140,7 @@ private static TestResourceNames GetResourcesToSkip()
"oracle" => TestResourceNames.oracledatabase,
"cosmos" => TestResourceNames.cosmos | TestResourceNames.efcosmos,
"eventhubs" => TestResourceNames.eventhubs,
"basicservices" => TestResourceNames.mongodb
| TestResourceNames.redis
"basicservices" => TestResourceNames.redis
| TestResourceNames.postgres
| TestResourceNames.efnpgsql
| TestResourceNames.sqlserver
Expand Down
1 change: 0 additions & 1 deletion tests/Aspire.EndToEnd.Tests/IntegrationServicesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public IntegrationServicesTests(ITestOutputHelper testOutput, IntegrationService

[Theory]
[Trait("scenario", "basicservices")]
[InlineData(TestResourceNames.mongodb)]
[InlineData(TestResourceNames.postgres)]
[InlineData(TestResourceNames.efnpgsql)]
[InlineData(TestResourceNames.redis)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System.Net.Sockets;
using Aspire.Hosting.MongoDB;
using Aspire.Hosting.ApplicationModel;
using Aspire.Hosting.Tests.Utils;
using Aspire.Hosting.Utils;
using Microsoft.Extensions.DependencyInjection;
using Xunit;

namespace Aspire.Hosting.Tests.MongoDB;
namespace Aspire.Hosting.MongoDB.Tests;

public class AddMongoDBTests
{
Expand Down Expand Up @@ -108,7 +108,8 @@ public void WithMongoExpressAddsContainer()
public void WithMongoExpressSupportsChangingContainerImageValues()
{
var builder = DistributedApplication.CreateBuilder();
builder.AddMongoDB("mongo").WithMongoExpress(c => {
builder.AddMongoDB("mongo").WithMongoExpress(c =>
{
c.WithImageRegistry("example.mycompany.com");
c.WithImage("customongoexpresscontainer");
c.WithImageTag("someothertag");
Expand All @@ -125,7 +126,8 @@ public void WithMongoExpressSupportsChangingContainerImageValues()
public void WithMongoExpressSupportsChangingHostPort()
{
var builder = DistributedApplication.CreateBuilder();
builder.AddMongoDB("mongo").WithMongoExpress(c => {
builder.AddMongoDB("mongo").WithMongoExpress(c =>
{
c.WithHostPort(1000);
});

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>$(NetCurrent)</TargetFramework>
<NoWarn>$(NoWarn);CS8002</NoWarn> <!-- MongoDB packages are not signed -->
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Aspire.Hosting.MongoDB\Aspire.Hosting.MongoDB.csproj" />
<ProjectReference Include="..\..\src\Components\Aspire.MongoDB.Driver\Aspire.MongoDB.Driver.csproj" />
<ProjectReference Include="..\Aspire.Hosting.Tests\Aspire.Hosting.Tests.csproj" />

<PackageReference Include="Microsoft.Extensions.Http.Resilience" />
</ItemGroup>

<ItemGroup>
<Compile Include="$(RepoRoot)src\Aspire.Hosting.MongoDB\MongoDBContainerImageTags.cs" />
<Compile Include="$(SharedDir)VolumeNameGenerator.cs" Link="Utils\VolumeNameGenerator.cs" />
<Compile Include="$(RepoRoot)src\Aspire.Hosting.Testing\ResourceLoggerForwarderService.cs" Link="Utils\ResourceLoggerForwarderService.cs" />
</ItemGroup>

</Project>
Loading