Skip to content

Commit 6de43ed

Browse files
authored
Extract Aspire.Hosting.Valkey.Tests project (#4930)
* Extract Aspire.Hosting.Valkey.Tests project Contributes to #3185 Contributes to #4294 * Respond to PR feedback
1 parent e2d4630 commit 6de43ed

File tree

17 files changed

+232
-82
lines changed

17 files changed

+232
-82
lines changed

Aspire.sln

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.Hosting.Qdrant.Tests
514514
EndProject
515515
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}"
516516
EndProject
517+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aspire.Hosting.Valkey.Tests", "tests\Aspire.Hosting.Valkey.Tests\Aspire.Hosting.Valkey.Tests.csproj", "{1C16DC2D-3B79-4081-AC1E-F3F965C61216}"
518+
EndProject
517519
Global
518520
GlobalSection(SolutionConfigurationPlatforms) = preSolution
519521
Debug|Any CPU = Debug|Any CPU
@@ -1332,18 +1334,22 @@ Global
13321334
{1BC02557-B78B-48CE-9D3C-488A6B7672F4}.Debug|Any CPU.Build.0 = Debug|Any CPU
13331335
{1BC02557-B78B-48CE-9D3C-488A6B7672F4}.Release|Any CPU.ActiveCfg = Release|Any CPU
13341336
{1BC02557-B78B-48CE-9D3C-488A6B7672F4}.Release|Any CPU.Build.0 = Release|Any CPU
1335-
{8E2AA85E-C351-47B4-AF91-58557FAD5840}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1336-
{8E2AA85E-C351-47B4-AF91-58557FAD5840}.Debug|Any CPU.Build.0 = Debug|Any CPU
1337-
{8E2AA85E-C351-47B4-AF91-58557FAD5840}.Release|Any CPU.ActiveCfg = Release|Any CPU
1338-
{8E2AA85E-C351-47B4-AF91-58557FAD5840}.Release|Any CPU.Build.0 = Release|Any CPU
13391337
{7425E5B2-BC47-4521-AC40-B8CECA329E08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13401338
{7425E5B2-BC47-4521-AC40-B8CECA329E08}.Debug|Any CPU.Build.0 = Debug|Any CPU
13411339
{7425E5B2-BC47-4521-AC40-B8CECA329E08}.Release|Any CPU.ActiveCfg = Release|Any CPU
13421340
{7425E5B2-BC47-4521-AC40-B8CECA329E08}.Release|Any CPU.Build.0 = Release|Any CPU
1341+
{8E2AA85E-C351-47B4-AF91-58557FAD5840}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1342+
{8E2AA85E-C351-47B4-AF91-58557FAD5840}.Debug|Any CPU.Build.0 = Debug|Any CPU
1343+
{8E2AA85E-C351-47B4-AF91-58557FAD5840}.Release|Any CPU.ActiveCfg = Release|Any CPU
1344+
{8E2AA85E-C351-47B4-AF91-58557FAD5840}.Release|Any CPU.Build.0 = Release|Any CPU
13431345
{0A83AA67-221E-44B4-9BA9-DC64DC17949E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13441346
{0A83AA67-221E-44B4-9BA9-DC64DC17949E}.Debug|Any CPU.Build.0 = Debug|Any CPU
13451347
{0A83AA67-221E-44B4-9BA9-DC64DC17949E}.Release|Any CPU.ActiveCfg = Release|Any CPU
13461348
{0A83AA67-221E-44B4-9BA9-DC64DC17949E}.Release|Any CPU.Build.0 = Release|Any CPU
1349+
{1C16DC2D-3B79-4081-AC1E-F3F965C61216}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1350+
{1C16DC2D-3B79-4081-AC1E-F3F965C61216}.Debug|Any CPU.Build.0 = Debug|Any CPU
1351+
{1C16DC2D-3B79-4081-AC1E-F3F965C61216}.Release|Any CPU.ActiveCfg = Release|Any CPU
1352+
{1C16DC2D-3B79-4081-AC1E-F3F965C61216}.Release|Any CPU.Build.0 = Release|Any CPU
13471353
EndGlobalSection
13481354
GlobalSection(SolutionProperties) = preSolution
13491355
HideSolutionNode = FALSE
@@ -1587,9 +1593,10 @@ Global
15871593
{C424395C-1235-41A4-BF55-07880A04368C} = {4981B3A5-4AFD-4191-BF7D-8692D9783D60}
15881594
{830A89EC-4029-4753-B25A-068BAE37DEC7} = {4981B3A5-4AFD-4191-BF7D-8692D9783D60}
15891595
{1BC02557-B78B-48CE-9D3C-488A6B7672F4} = {830A89EC-4029-4753-B25A-068BAE37DEC7}
1590-
{8E2AA85E-C351-47B4-AF91-58557FAD5840} = {830A89EC-4029-4753-B25A-068BAE37DEC7}
15911596
{7425E5B2-BC47-4521-AC40-B8CECA329E08} = {830A89EC-4029-4753-B25A-068BAE37DEC7}
1597+
{8E2AA85E-C351-47B4-AF91-58557FAD5840} = {830A89EC-4029-4753-B25A-068BAE37DEC7}
15921598
{0A83AA67-221E-44B4-9BA9-DC64DC17949E} = {830A89EC-4029-4753-B25A-068BAE37DEC7}
1599+
{1C16DC2D-3B79-4081-AC1E-F3F965C61216} = {830A89EC-4029-4753-B25A-068BAE37DEC7}
15931600
EndGlobalSection
15941601
GlobalSection(ExtensibilityGlobals) = postSolution
15951602
SolutionGuid = {6DCEDFEC-988E-4CB3-B45B-191EB5086E0C}

tests/Aspire.EndToEnd.Tests/IntegrationServicesFixture.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ public Task DumpComponentLogsAsync(TestResourceNames resource, ITestOutputHelper
117117
TestResourceNames.rabbitmq => "rabbitmq",
118118
TestResourceNames.redis => "redis",
119119
TestResourceNames.sqlserver or TestResourceNames.efsqlserver => "sqlserver",
120-
TestResourceNames.valkey => "valkey",
121120
_ => throw new ArgumentException($"Unknown resource: {resource}")
122121
};
123122

@@ -154,7 +153,6 @@ private static TestResourceNames GetResourcesToSkip()
154153
| TestResourceNames.rabbitmq
155154
| TestResourceNames.redis
156155
| TestResourceNames.garnet
157-
| TestResourceNames.valkey
158156
| TestResourceNames.postgres
159157
| TestResourceNames.efnpgsql
160158
| TestResourceNames.mysql

tests/Aspire.EndToEnd.Tests/IntegrationServicesTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ public IntegrationServicesTests(ITestOutputHelper testOutput, IntegrationService
3131
[InlineData(TestResourceNames.rabbitmq)]
3232
[InlineData(TestResourceNames.redis)]
3333
[InlineData(TestResourceNames.garnet)]
34-
[InlineData(TestResourceNames.valkey)]
3534
[InlineData(TestResourceNames.sqlserver)]
3635
[InlineData(TestResourceNames.efsqlserver)]
3736
[InlineData(TestResourceNames.milvus)]

tests/Aspire.Hosting.Kafka.Tests/KafkaFunctionalTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ await pipeline.ExecuteAsync(async token =>
212212
{
213213
try
214214
{
215-
File.Delete(bindMountPath);
215+
Directory.Delete(bindMountPath, recursive: true);
216216
}
217217
catch
218218
{

tests/Aspire.Hosting.PostgreSQL.Tests/PostgresFunctionalTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ await pipeline.ExecuteAsync(
219219
{
220220
try
221221
{
222-
File.Delete(bindMountPath);
222+
Directory.Delete(bindMountPath, recursive: true);
223223
}
224224
catch
225225
{

tests/Aspire.Hosting.Qdrant.Tests/QdrantFunctionalTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ await pipeline.ExecuteAsync(async token =>
208208
{
209209
try
210210
{
211-
File.Delete(bindMountPath);
211+
Directory.Delete(bindMountPath, recursive: true);
212212
}
213213
catch
214214
{
@@ -224,4 +224,4 @@ private TestDistributedApplicationBuilder CreateDistributedApplicationBuilder()
224224
builder.Services.AddXunitLogging(testOutputHelper);
225225
return builder;
226226
}
227-
}
227+
}

tests/Aspire.Hosting.Redis.Tests/RedisFunctionalTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public async Task WithDataBindMountShouldPersistStateBetweenUsages()
217217

218218
try
219219
{
220-
File.Delete(bindMountPath);
220+
Directory.Delete(bindMountPath, recursive: true);
221221
}
222222
catch
223223
{

tests/Aspire.Hosting.Tests/Aspire.Hosting.Tests.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
<ProjectReference Include="..\..\src\Aspire.Hosting.Nats\Aspire.Hosting.Nats.csproj" IsAspireProjectResource="false" />
3737
<ProjectReference Include="..\..\src\Aspire.Hosting.Testing\Aspire.Hosting.Testing.csproj" />
3838
<ProjectReference Include="..\..\src\Aspire.Hosting.Python\Aspire.Hosting.Python.csproj" IsAspireProjectResource="false" />
39-
<ProjectReference Include="..\..\src\Aspire.Hosting.Valkey\Aspire.Hosting.Valkey.csproj" IsAspireProjectResource="false" />
4039
<ProjectReference Include="..\Aspire.Components.Common.Tests\Aspire.Components.Common.Tests.csproj" IsAspireProjectResource="false" />
4140
<ProjectReference Include="..\testproject\TestProject.AppHost\TestProject.AppHost.csproj" IsAspireProjectResource="false" />
4241
<ProjectReference Include="..\Aspire.Hosting.Tests.SharedShim\Aspire.Hosting.Tests.SharedShim.csproj" IsAspireProjectResource="false" Aliases="AspireHostingShared" />
@@ -63,7 +62,6 @@
6362
<Compile Include="$(RepoRoot)src\Aspire.Hosting.Redis\RedisContainerImageTags.cs" />
6463
<Compile Include="$(RepoRoot)src\Aspire.Hosting.Qdrant\QdrantContainerImageTags.cs" />
6564
<Compile Include="$(RepoRoot)src\Aspire.Hosting.SqlServer\SqlServerContainerImageTags.cs" />
66-
<Compile Include="$(RepoRoot)src\Aspire.Hosting.Valkey\ValkeyContainerImageTags.cs" />
6765
<Compile Include="$(RepoRoot)src\Aspire.Hosting.Azure.EventHubs\EventHubsEmulatorContainerImageTags.cs" />
6866

6967
<Compile Include="$(RepoRoot)tests\Aspire.Hosting.Testing.Tests\DistributedApplicationHttpClientExtensionsForTests.cs" />

tests/Aspire.Hosting.Tests/ManifestGenerationTests.cs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
using Aspire.Hosting.Redis;
1313
using Aspire.Hosting.Tests.Helpers;
1414
using Aspire.Hosting.Utils;
15-
using Aspire.Hosting.Valkey;
1615
using Microsoft.Extensions.DependencyInjection;
1716
using Xunit;
1817

@@ -484,7 +483,6 @@ public void VerifyTestProgramFullManifest()
484483
"ConnectionStrings__mysqldb": "{mysqldb.connectionString}",
485484
"ConnectionStrings__redis": "{redis.connectionString}",
486485
"ConnectionStrings__garnet": "{garnet.connectionString}",
487-
"ConnectionStrings__valkey": "{valkey.connectionString}",
488486
"ConnectionStrings__postgresdb": "{postgresdb.connectionString}",
489487
"ConnectionStrings__rabbitmq": "{rabbitmq.connectionString}",
490488
"ConnectionStrings__mymongodb": "{mymongodb.connectionString}",
@@ -574,19 +572,6 @@ public void VerifyTestProgramFullManifest()
574572
}
575573
}
576574
},
577-
"valkey": {
578-
"type": "container.v0",
579-
"connectionString": "{valkey.bindings.tcp.host}:{valkey.bindings.tcp.port}",
580-
"image": "{{TestConstants.AspireTestContainerRegistry}}/{{ValkeyContainerImageTags.Image}}:{{ValkeyContainerImageTags.Tag}}",
581-
"bindings": {
582-
"tcp": {
583-
"scheme": "tcp",
584-
"protocol": "tcp",
585-
"transport": "tcp",
586-
"targetPort": 6379
587-
}
588-
}
589-
},
590575
"postgres": {
591576
"type": "container.v0",
592577
"connectionString": "Host={postgres.bindings.tcp.host};Port={postgres.bindings.tcp.port};Username=postgres;Password={postgres-password.value}",

tests/Aspire.Hosting.Tests/Valkey/AddValkeyTests.cs renamed to tests/Aspire.Hosting.Valkey.Tests/AddValkeyTests.cs

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

44
using System.Net.Sockets;
5+
using Aspire.Hosting.ApplicationModel;
56
using Aspire.Hosting.Utils;
6-
using Aspire.Hosting.Valkey;
77
using Microsoft.Extensions.DependencyInjection;
88
using Xunit;
99

10-
namespace Aspire.Hosting.Tests.Valkey;
10+
namespace Aspire.Hosting.Valkey.Tests;
1111

1212
public class AddValkeyTests
1313
{

0 commit comments

Comments
 (0)