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.Oracle.Tests #4943

Merged
merged 78 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
485fcdd
Extract Aspire.Hosting.Oracle.Tests
sebastienros Jul 17, 2024
ba3663b
Merge branch 'main' into sebros/oracletests
sebastienros Jul 17, 2024
56a2a4a
Merge remote-tracking branch 'origin/main' into sebros/oracletests
sebastienros Jul 19, 2024
d6a8d4b
Remove E2E tests
sebastienros Jul 19, 2024
b5a8713
Test folder permissions
sebastienros Jul 19, 2024
c031eb1
Increase timeouts
sebastienros Jul 19, 2024
c74bdca
Increase timeout
sebastienros Jul 19, 2024
502fe09
Merge remote-tracking branch 'origin/main' into sebros/oracletests
radical Jul 20, 2024
52b99e9
Add OracleContainerFixture
sebastienros Jul 22, 2024
6b674e1
Merge remote-tracking branch 'origin/main' into sebros/oracletests
sebastienros Jul 22, 2024
241db48
PR feedback
sebastienros Jul 22, 2024
60199dc
Fix unit test
sebastienros Jul 22, 2024
5cf3c8f
Bum test timeout
sebastienros Jul 22, 2024
f2eed7b
Override runsettings file
sebastienros Jul 22, 2024
084bef2
Remove project reference
sebastienros Jul 24, 2024
0cd4b0a
Merge branch 'main' into sebros/oracletests
sebastienros Jul 24, 2024
71478c8
Remove fixture, increase eash test's timeout
sebastienros Jul 24, 2024
76ec658
Attempt different retry approach
sebastienros Jul 24, 2024
196e866
Merge branch 'main' into sebros/oracletests
sebastienros Jul 29, 2024
4cd6625
Monitor database events
sebastienros Jul 30, 2024
bad66ce
Test different image
sebastienros Jul 30, 2024
b5f1efd
Update image
sebastienros Jul 30, 2024
b645712
Helix
sebastienros Jul 30, 2024
66c3390
Remove Helix
sebastienros Jul 30, 2024
342c993
Dump Oracle diagnotics files in logs
sebastienros Jul 31, 2024
cc60731
Merge branch 'main' into sebros/oracletests
sebastienros Jul 31, 2024
9efbac9
No retries
sebastienros Jul 31, 2024
9d41090
Do more connections attempts
sebastienros Aug 1, 2024
4bf7abd
Run more tests
sebastienros Aug 1, 2024
56bdb6f
Collect traces in all cases
sebastienros Aug 1, 2024
1364a20
Log stderr
sebastienros Aug 1, 2024
dc512d2
Adding log
sebastienros Aug 1, 2024
5829bb8
Merge branch 'main' into sebros/oracletests
sebastienros Aug 1, 2024
73b6233
Keep the test which works
sebastienros Aug 1, 2024
cf04380
Update tests/Aspire.Hosting.Oracle.Tests/OracleFunctionalTests.cs
sebastienros Aug 1, 2024
2cc78d6
Update csproj
sebastienros Aug 1, 2024
1dd4f1c
Fix build
sebastienros Aug 1, 2024
7c6c0c1
Increase Oracle timeout
sebastienros Aug 2, 2024
9c457a7
More time
sebastienros Aug 2, 2024
fb19b49
Longer
sebastienros Aug 2, 2024
872989d
Fix build
sebastienros Aug 2, 2024
5343e35
Skip CanConnectAsync
sebastienros Aug 2, 2024
1a4e523
Use faster docker image
sebastienros Aug 2, 2024
af9fe86
Add VerifyWithInitBindMount tests
sebastienros Aug 5, 2024
8aaa8d2
Add WithDataBindMount tests
sebastienros Aug 6, 2024
6e576ef
Update skip reason
sebastienros Aug 6, 2024
5582948
Use SetUnixFileMode instead of chmod
sebastienros Aug 6, 2024
27b3ea0
PR feedback
sebastienros Aug 6, 2024
20bf3ef
Merge branch 'main' into sebros/oracletests
sebastienros Aug 6, 2024
ec0afa4
Return expected value for retries
sebastienros Aug 6, 2024
4251e1d
Merge remote-tracking branch 'origin/main' into sebros/oracletests
sebastienros Aug 6, 2024
b686c1f
React to testing changes in main
sebastienros Aug 6, 2024
c231f38
Don't use test registry
sebastienros Aug 7, 2024
5cb9b06
Reuse DbContext instance
sebastienros Aug 7, 2024
c6e7d4f
Increase absolute test timeouts
sebastienros Aug 7, 2024
6ff4a0e
Merge branch 'main' into sebros/oracletests
sebastienros Aug 7, 2024
b228b8e
Merge branch 'main' into sebros/oracletests
sebastienros Aug 7, 2024
6b0d495
Make use of const message
sebastienros Aug 8, 2024
a548f7b
Merge remote-tracking branch 'origin/main' into sebros/oracletests
sebastienros Aug 8, 2024
1046ebc
Fix manifest test
sebastienros Aug 8, 2024
7361476
Remove package references
sebastienros Aug 8, 2024
fcb2377
Use local runsettings to increase test timeout
sebastienros Aug 9, 2024
28b7ba2
Merge branch 'main' into sebros/oracletests
sebastienros Aug 13, 2024
df9425e
Increase timeout on helix
sebastienros Aug 13, 2024
80dc251
Merge branch 'main' into sebros/oracletests
sebastienros Aug 14, 2024
10a209d
Merge remote-tracking branch 'origin/main' into sebros/oracletests
sebastienros Aug 14, 2024
3b017e0
Merge remote-tracking branch 'origin/main' into sebros/oracletests
sebastienros Aug 15, 2024
fee8b0b
Update tests/testproject/TestProject.IntegrationServiceA/TestProject.…
sebastienros Aug 15, 2024
402ab40
Update tests/Aspire.Hosting.Tests/Aspire.Hosting.Tests.csproj
sebastienros Aug 15, 2024
52fa7a1
Update tests/Aspire.Hosting.Oracle.Tests/OracleFunctionalTests.cs
sebastienros Aug 15, 2024
b36e388
Update OracleFunctionalTests.cs
sebastienros Aug 15, 2024
9124b16
Update tests/testproject/TestProject.IntegrationServiceA/TestProject.…
sebastienros Aug 15, 2024
b16c864
Update OracleFunctionalTests.cs
sebastienros Aug 15, 2024
d869131
Merge remote-tracking branch 'origin/main' into sebros/oracletests
sebastienros Aug 16, 2024
59b9dae
Remove CanConnectAsync
sebastienros Aug 16, 2024
f5d9001
Wait for stopped instances
sebastienros Aug 16, 2024
c3bb1b9
Disable functional tests
sebastienros Aug 20, 2024
baacfe5
Merge remote-tracking branch 'origin/main' into sebros/oracletests
sebastienros Aug 20, 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
9 changes: 9 additions & 0 deletions Aspire.sln
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.Hosting.PostgreSQL.T
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.Hosting.Qdrant.Tests", "tests\Aspire.Hosting.Qdrant.Tests\Aspire.Hosting.Qdrant.Tests.csproj", "{8E2AA85E-C351-47B4-AF91-58557FAD5840}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.Hosting.Oracle.Tests", "tests\Aspire.Hosting.Oracle.Tests\Aspire.Hosting.Oracle.Tests.csproj", "{8759FBB6-008F-4F11-80D9-073FDC1810EC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.Hosting.Kafka.Tests", "tests\Aspire.Hosting.Kafka.Tests\Aspire.Hosting.Kafka.Tests.csproj", "{0A83AA67-221E-44B4-9BA9-DC64DC17949E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.Hosting.Python.Tests", "tests\Aspire.Hosting.Python.Tests\Aspire.Hosting.Python.Tests.csproj", "{72F5A6F3-3516-402B-8F8D-50A7BC2E4BD4}"
Expand Down Expand Up @@ -1403,6 +1405,10 @@ Global
{8E2AA85E-C351-47B4-AF91-58557FAD5840}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8E2AA85E-C351-47B4-AF91-58557FAD5840}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8E2AA85E-C351-47B4-AF91-58557FAD5840}.Release|Any CPU.Build.0 = Release|Any CPU
{8759FBB6-008F-4F11-80D9-073FDC1810EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8759FBB6-008F-4F11-80D9-073FDC1810EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8759FBB6-008F-4F11-80D9-073FDC1810EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8759FBB6-008F-4F11-80D9-073FDC1810EC}.Release|Any CPU.Build.0 = Release|Any CPU
{0A83AA67-221E-44B4-9BA9-DC64DC17949E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0A83AA67-221E-44B4-9BA9-DC64DC17949E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0A83AA67-221E-44B4-9BA9-DC64DC17949E}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -1689,6 +1695,9 @@ Global
{C424395C-1235-41A4-BF55-07880A04368C} = {4981B3A5-4AFD-4191-BF7D-8692D9783D60}
{830A89EC-4029-4753-B25A-068BAE37DEC7} = {4981B3A5-4AFD-4191-BF7D-8692D9783D60}
{1BC02557-B78B-48CE-9D3C-488A6B7672F4} = {830A89EC-4029-4753-B25A-068BAE37DEC7}
{7425E5B2-BC47-4521-AC40-B8CECA329E08} = {830A89EC-4029-4753-B25A-068BAE37DEC7}
{8E2AA85E-C351-47B4-AF91-58557FAD5840} = {830A89EC-4029-4753-B25A-068BAE37DEC7}
{8759FBB6-008F-4F11-80D9-073FDC1810EC} = {830A89EC-4029-4753-B25A-068BAE37DEC7}
{72F5A6F3-3516-402B-8F8D-50A7BC2E4BD4} = {830A89EC-4029-4753-B25A-068BAE37DEC7}
{7425E5B2-BC47-4521-AC40-B8CECA329E08} = {830A89EC-4029-4753-B25A-068BAE37DEC7}
{8E2AA85E-C351-47B4-AF91-58557FAD5840} = {830A89EC-4029-4753-B25A-068BAE37DEC7}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<ItemGroup>
<Compile Include="$(SharedDir)StringComparers.cs" Link="Utils\StringComparers.cs" />
<Compile Include="$(SharedDir)VolumeNameGenerator.cs" Link="Utils\VolumeNameGenerator.cs" />
<Compile Include="$(RepoRoot)src\Aspire.Hosting.Testing\ResourceLoggerForwarderService.cs" Link="Utils\ResourceLoggerForwarderService.cs" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions src/Aspire.Hosting.Testing/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#nullable enable
Aspire.Hosting.Testing.DistributedApplicationFactory.DistributedApplicationFactory(System.Type! entryPoint, string![]! args) -> void
Aspire.Hosting.Testing.IDistributedApplicationTestingBuilder.AppHostAssembly.get -> System.Reflection.Assembly?
Aspire.Hosting.Testing.ResourceLoggerForwarderService
Aspire.Hosting.Testing.ResourceLoggerForwarderService.OnResourceLog.get -> System.Action<string!>?
Aspire.Hosting.Testing.ResourceLoggerForwarderService.OnResourceLog.set -> void
Aspire.Hosting.Testing.ResourceLoggerForwarderService.ResourceLoggerForwarderService(Aspire.Hosting.ApplicationModel.ResourceNotificationService! resourceNotificationService, Aspire.Hosting.ApplicationModel.ResourceLoggerService! resourceLoggerService, Microsoft.Extensions.Hosting.IHostEnvironment! hostEnvironment, Microsoft.Extensions.Logging.ILoggerFactory! loggerFactory) -> void
static Aspire.Hosting.Testing.DistributedApplicationTestingBuilder.CreateAsync(System.Type! entryPoint, string![]! args, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task<Aspire.Hosting.Testing.IDistributedApplicationTestingBuilder!>!
static Aspire.Hosting.Testing.DistributedApplicationTestingBuilder.CreateAsync<TEntryPoint>(string![]! args, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task<Aspire.Hosting.Testing.IDistributedApplicationTestingBuilder!>!
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Aspire.Hosting.Testing;
/// <summary>
/// A background service that watches resource logs and forwards them to the host's <see cref="ILogger"/> infrastructure.
/// </summary>
internal sealed class ResourceLoggerForwarderService(
public sealed class ResourceLoggerForwarderService(
sebastienros marked this conversation as resolved.
Show resolved Hide resolved
ResourceNotificationService resourceNotificationService,
ResourceLoggerService resourceLoggerService,
IHostEnvironment hostEnvironment,
Expand Down
3 changes: 0 additions & 3 deletions tests/Aspire.EndToEnd.Tests/IntegrationServicesFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ public Task DumpComponentLogsAsync(TestResourceNames resource, ITestOutputHelper
TestResourceNames.milvus => "milvus",
TestResourceNames.mongodb => "mongodb",
TestResourceNames.mysql or TestResourceNames.efmysql => "mysql",
TestResourceNames.oracledatabase => "oracledatabase",
TestResourceNames.postgres or TestResourceNames.efnpgsql => "postgres",
TestResourceNames.rabbitmq => "rabbitmq",
TestResourceNames.redis => "redis",
Expand Down Expand Up @@ -142,7 +141,6 @@ private static TestResourceNames GetResourcesToSkip()
{
TestResourceNames resourcesToInclude = TestScenario switch
{
"oracle" => TestResourceNames.oracledatabase,
"cosmos" => TestResourceNames.cosmos | TestResourceNames.efcosmos,
"eventhubs" => TestResourceNames.eventhubs,
"basicservices" => TestResourceNames.mongodb
Expand Down Expand Up @@ -173,7 +171,6 @@ private static TestResourceNames GetResourcesToSkip()
if (BuildEnvironment.IsRunningOnCI)
{
resourcesToSkip |= TestResourceNames.cosmos;
resourcesToSkip |= TestResourceNames.oracledatabase;
}
}

Expand Down
7 changes: 0 additions & 7 deletions tests/Aspire.EndToEnd.Tests/IntegrationServicesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ public Task VerifyComponentWorks(TestResourceNames resourceName)
public Task VerifyAzureEventHubsComponentWorks()
=> VerifyComponentWorks(TestResourceNames.eventhubs);

[ConditionalFact]
[SkipOnCI("https://github.com/dotnet/aspire/issues/3161")]
sebastienros marked this conversation as resolved.
Show resolved Hide resolved
[Trait("scenario", "oracle")]
public Task VerifyOracleComponentWorks()
=> VerifyComponentWorks(TestResourceNames.oracledatabase);

[ConditionalTheory]
[Trait("scenario", "cosmos")]
[InlineData(TestResourceNames.cosmos)]
Expand All @@ -80,7 +74,6 @@ public Task VerifyCosmosComponentWorks(TestResourceNames resourceName)
[Fact]
// Include all the scenarios here so this test gets run for all of them.
[Trait("scenario", "cosmos")]
[Trait("scenario", "oracle")]
[Trait("scenario", "basicservices")]
public Task VerifyHealthyOnIntegrationServiceA()
=> RunTestAsync(async () =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
// The .NET Foundation licenses this file to you under the MIT license.

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

namespace Aspire.Hosting.Tests.Oracle;
namespace Aspire.Hosting.Oracle.Tests;

public class AddOracleTests
{
Expand All @@ -18,7 +19,7 @@ public void AddOracleAddsGeneratedPasswordParameterWithUserSecretsParameterDefau

var orcl = appBuilder.AddOracle("orcl");

Assert.IsType<UserSecretsParameterDefault>(orcl.Resource.PasswordParameter.Default);
Assert.Equal(nameof(UserSecretsParameterDefault), orcl.Resource.PasswordParameter.Default?.GetType().Name);
sebastienros marked this conversation as resolved.
Show resolved Hide resolved
}

[Fact]
Expand All @@ -28,7 +29,7 @@ public void AddOracleDoesNotAddGeneratedPasswordParameterWithUserSecretsParamete

var orcl = appBuilder.AddOracle("orcl");

Assert.IsNotType<UserSecretsParameterDefault>(orcl.Resource.PasswordParameter.Default);
Assert.Equal(nameof(GenerateParameterDefault), orcl.Resource.PasswordParameter.Default?.GetType().Name);
}

[Fact]
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>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Aspire.Hosting.AppHost\Aspire.Hosting.AppHost.csproj" />
<ProjectReference Include="..\Aspire.Hosting.Tests\Aspire.Hosting.Tests.csproj" />
<ProjectReference Include="..\..\src\Aspire.Hosting.Oracle\Aspire.Hosting.Oracle.csproj" />
<ProjectReference Include="..\..\src\Components\Aspire.Oracle.EntityFrameworkCore\Aspire.Oracle.EntityFrameworkCore.csproj" IsAspireProjectResource="false" />
</ItemGroup>

<ItemGroup>
<Compile Include="$(SharedDir)SecretsStore.cs" Link="Utils\SecretsStore.cs" />
<Compile Include="$(RepoRoot)src\Aspire.Hosting\ApplicationModel\UserSecretsParameterDefault.cs" Link="Utils\UserSecretsParameterDefault.cs" />
<Compile Include="$(RepoRoot)src\Aspire.Hosting.Oracle\OracleContainerImageTags.cs" />
<Compile Include="$(SharedDir)VolumeNameGenerator.cs" Link="Utils\VolumeNameGenerator.cs" />
<Compile Include="$(RepoRoot)src\Aspire.Hosting\Utils\PasswordGenerator.cs" Link="Utils\PasswordGenerator.cs" />
sebastienros marked this conversation as resolved.
Show resolved Hide resolved
</ItemGroup>

</Project>
Loading
Loading