From 6173930f32f802d069f5fd3b62f1dbbfd320cdde Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Thu, 15 Aug 2024 00:50:15 -0400 Subject: [PATCH] [tests] Add tests for more Playground apps (#5294) - Add `milvus` playground app to the tests. - Skip the redis commander in `TestShop` for tests, as it requires connecting to other containers which is not supported on our CI yet. And we don't really connect, and check the web app. - Reduce log level to `debug` from `trace`. --- playground/TestShop/TestShop.AppHost/Program.cs | 13 ++++++++----- tests/Aspire.Playground.Tests/AppHostTests.cs | 2 ++ .../Aspire.Playground.Tests.csproj | 1 + .../DistributedApplicationTestFactory.cs | 6 +++--- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/playground/TestShop/TestShop.AppHost/Program.cs b/playground/TestShop/TestShop.AppHost/Program.cs index d2fc6910f1..8e3f5d256f 100644 --- a/playground/TestShop/TestShop.AppHost/Program.cs +++ b/playground/TestShop/TestShop.AppHost/Program.cs @@ -6,11 +6,14 @@ .AddDatabase("catalogdb"); var basketCache = builder.AddRedis("basketcache") - .WithDataVolume() - .WithRedisCommander(c => - { - c.WithHostPort(33801); - }); + .WithDataVolume(); + +#if !SKIP_DASHBOARD_REFERENCE +basketCache.WithRedisCommander(c => + { + c.WithHostPort(33801); + }); +#endif var catalogService = builder.AddProject("catalogservice") .WithReference(catalogDb) diff --git a/tests/Aspire.Playground.Tests/AppHostTests.cs b/tests/Aspire.Playground.Tests/AppHostTests.cs index d7d4fdb297..32010852e6 100644 --- a/tests/Aspire.Playground.Tests/AppHostTests.cs +++ b/tests/Aspire.Playground.Tests/AppHostTests.cs @@ -166,6 +166,8 @@ public static TheoryData TestEndpoints() { IList candidates = [ + new TestEndpoints("MilvusPlayground.AppHost", + resourceEndpoints: new() { { "apiservice", ["/alive", "/health", "/create", "/search"] } }), new TestEndpoints("CosmosEndToEnd.AppHost", resourceEndpoints: new() { { "api", ["/alive", "/health", "/", "/ef"] } }, waitForTexts: [ diff --git a/tests/Aspire.Playground.Tests/Aspire.Playground.Tests.csproj b/tests/Aspire.Playground.Tests/Aspire.Playground.Tests.csproj index 3b99926535..4be3b38cce 100644 --- a/tests/Aspire.Playground.Tests/Aspire.Playground.Tests.csproj +++ b/tests/Aspire.Playground.Tests/Aspire.Playground.Tests.csproj @@ -42,6 +42,7 @@ + diff --git a/tests/Aspire.Playground.Tests/Infrastructure/DistributedApplicationTestFactory.cs b/tests/Aspire.Playground.Tests/Infrastructure/DistributedApplicationTestFactory.cs index 5322ebcc02..cfcdf3e4d6 100644 --- a/tests/Aspire.Playground.Tests/Infrastructure/DistributedApplicationTestFactory.cs +++ b/tests/Aspire.Playground.Tests/Infrastructure/DistributedApplicationTestFactory.cs @@ -46,9 +46,9 @@ public static async Task CreateAsync(stri { logging.AddXunit(testOutput); } - logging.SetMinimumLevel(LogLevel.Trace); - logging.AddFilter("Aspire", LogLevel.Trace); - logging.AddFilter(builder.Environment.ApplicationName, LogLevel.Trace); + logging.SetMinimumLevel(LogLevel.Debug); + logging.AddFilter("Aspire", LogLevel.Debug); + logging.AddFilter(builder.Environment.ApplicationName, LogLevel.Debug); }); return builder;