From 4ce7c2beb028c8dad6a23ae160dddd5f32b85dd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Sun, 22 Dec 2024 02:27:48 +0100 Subject: [PATCH 1/2] Using TestCancellationToken in UI tests --- .../Extensions/IdleTenantManagementExtensions.cs | 5 +++-- .../Extensions/TestCaseUITestContextExtensions.cs | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI/Extensions/IdleTenantManagementExtensions.cs b/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI/Extensions/IdleTenantManagementExtensions.cs index 6d81fd3..f4446c4 100644 --- a/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI/Extensions/IdleTenantManagementExtensions.cs +++ b/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI/Extensions/IdleTenantManagementExtensions.cs @@ -34,7 +34,8 @@ public static void ConfigureIdleTenantManagementTestSettings(this OrchardCoreUIT (_, fakeLogCollectorOptions) => fakeLogCollectorOptions.FilteredLevels.Add(LogLevel.Information); configuration.AssertAppLogsAsync = app => - app.LogsShouldNotContainAsync(logEntry => - AppLogAssertionHelper.NotMediaCacheEntries(logEntry) && logEntry.Level != LogLevel.Information); + app.LogsShouldNotContainAsync( + logEntry => AppLogAssertionHelper.NotMediaCacheEntries(logEntry) && logEntry.Level != LogLevel.Information, + configuration.TestCancellationToken); } } diff --git a/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI/Extensions/TestCaseUITestContextExtensions.cs b/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI/Extensions/TestCaseUITestContextExtensions.cs index fadc7cc..0d8b6e4 100644 --- a/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI/Extensions/TestCaseUITestContextExtensions.cs +++ b/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI/Extensions/TestCaseUITestContextExtensions.cs @@ -32,11 +32,11 @@ await context.GoToSetupPageAndSetupOrchardCoreAsync( // Due to the background ask scheduling configuration in ConfigureIdleTenantManagementTestSettings(), the // background task should run within not much more than a minute (background tasks are run with a frequency of // at least a minute, due to the limitation of cron expressions). Polling for it here. - await Task.Delay(TimeSpan.FromMinutes(1)); + await Task.Delay(TimeSpan.FromMinutes(1), context.Configuration.TestCancellationToken); await ReliabilityHelper.DoWithRetriesOrFailAsync( async () => { - var logEntries = await context.Application.GetLogEntriesFromAllLogsAsync(); + var logEntries = await context.Application.GetLogEntriesFromAllLogsAsync(context.Configuration.TestCancellationToken); return logEntries.Any(logEntry => logEntry.Message == $"Shutting down tenant \"{IdleTenantName}\" because of idle timeout."); }, From 1a272cf765ca00d989cddd8da1461e49aa52cdcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Sun, 22 Dec 2024 03:20:20 +0100 Subject: [PATCH 2/2] Updating Lombiq NuGet references --- .../Lombiq.Hosting.Tenants.EmailQuotaManagement.Tests.UI.csproj | 2 +- .../Lombiq.Hosting.Tenants.EmailQuotaManagement.csproj | 2 +- .../Lombiq.Hosting.Tenants.EnvironmentRobots.Tests.UI.csproj | 2 +- .../Lombiq.Hosting.Tenants.FeaturesGuard.Tests.UI.csproj | 2 +- .../Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI.csproj | 2 +- .../Lombiq.Hosting.Tenants.Maintenance.Tests.UI.csproj | 2 +- .../Lombiq.Hosting.Tenants.Management.Tests.UI.csproj | 2 +- ...ombiq.Hosting.Tenants.MediaStorageManagement.Tests.UI.csproj | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Lombiq.Hosting.Tenants.EmailQuotaManagement.Tests.UI/Lombiq.Hosting.Tenants.EmailQuotaManagement.Tests.UI.csproj b/Lombiq.Hosting.Tenants.EmailQuotaManagement.Tests.UI/Lombiq.Hosting.Tenants.EmailQuotaManagement.Tests.UI.csproj index 2c2e145..1699096 100644 --- a/Lombiq.Hosting.Tenants.EmailQuotaManagement.Tests.UI/Lombiq.Hosting.Tenants.EmailQuotaManagement.Tests.UI.csproj +++ b/Lombiq.Hosting.Tenants.EmailQuotaManagement.Tests.UI/Lombiq.Hosting.Tenants.EmailQuotaManagement.Tests.UI.csproj @@ -32,7 +32,7 @@ - + diff --git a/Lombiq.Hosting.Tenants.EmailQuotaManagement/Lombiq.Hosting.Tenants.EmailQuotaManagement.csproj b/Lombiq.Hosting.Tenants.EmailQuotaManagement/Lombiq.Hosting.Tenants.EmailQuotaManagement.csproj index 4a3de90..de02054 100644 --- a/Lombiq.Hosting.Tenants.EmailQuotaManagement/Lombiq.Hosting.Tenants.EmailQuotaManagement.csproj +++ b/Lombiq.Hosting.Tenants.EmailQuotaManagement/Lombiq.Hosting.Tenants.EmailQuotaManagement.csproj @@ -51,6 +51,6 @@ - + diff --git a/Lombiq.Hosting.Tenants.EnvironmentRobots.Tests.UI/Lombiq.Hosting.Tenants.EnvironmentRobots.Tests.UI.csproj b/Lombiq.Hosting.Tenants.EnvironmentRobots.Tests.UI/Lombiq.Hosting.Tenants.EnvironmentRobots.Tests.UI.csproj index 09d9350..14160fa 100644 --- a/Lombiq.Hosting.Tenants.EnvironmentRobots.Tests.UI/Lombiq.Hosting.Tenants.EnvironmentRobots.Tests.UI.csproj +++ b/Lombiq.Hosting.Tenants.EnvironmentRobots.Tests.UI/Lombiq.Hosting.Tenants.EnvironmentRobots.Tests.UI.csproj @@ -21,7 +21,7 @@ - + diff --git a/Lombiq.Hosting.Tenants.FeaturesGuard.Tests.UI/Lombiq.Hosting.Tenants.FeaturesGuard.Tests.UI.csproj b/Lombiq.Hosting.Tenants.FeaturesGuard.Tests.UI/Lombiq.Hosting.Tenants.FeaturesGuard.Tests.UI.csproj index 884003a..661a9ec 100644 --- a/Lombiq.Hosting.Tenants.FeaturesGuard.Tests.UI/Lombiq.Hosting.Tenants.FeaturesGuard.Tests.UI.csproj +++ b/Lombiq.Hosting.Tenants.FeaturesGuard.Tests.UI/Lombiq.Hosting.Tenants.FeaturesGuard.Tests.UI.csproj @@ -32,7 +32,7 @@ - + diff --git a/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI.csproj b/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI.csproj index 719c127..8bbfc8c 100644 --- a/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI.csproj +++ b/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI.csproj @@ -21,7 +21,7 @@ - + diff --git a/Lombiq.Hosting.Tenants.Maintenance.Tests.UI/Lombiq.Hosting.Tenants.Maintenance.Tests.UI.csproj b/Lombiq.Hosting.Tenants.Maintenance.Tests.UI/Lombiq.Hosting.Tenants.Maintenance.Tests.UI.csproj index f36536f..4f51f32 100644 --- a/Lombiq.Hosting.Tenants.Maintenance.Tests.UI/Lombiq.Hosting.Tenants.Maintenance.Tests.UI.csproj +++ b/Lombiq.Hosting.Tenants.Maintenance.Tests.UI/Lombiq.Hosting.Tenants.Maintenance.Tests.UI.csproj @@ -21,7 +21,7 @@ - + diff --git a/Lombiq.Hosting.Tenants.Management.Tests.UI/Lombiq.Hosting.Tenants.Management.Tests.UI.csproj b/Lombiq.Hosting.Tenants.Management.Tests.UI/Lombiq.Hosting.Tenants.Management.Tests.UI.csproj index 0ba60b1..1025eea 100644 --- a/Lombiq.Hosting.Tenants.Management.Tests.UI/Lombiq.Hosting.Tenants.Management.Tests.UI.csproj +++ b/Lombiq.Hosting.Tenants.Management.Tests.UI/Lombiq.Hosting.Tenants.Management.Tests.UI.csproj @@ -21,7 +21,7 @@ - + diff --git a/Lombiq.Hosting.Tenants.MediaStorageManagement.Tests.UI/Lombiq.Hosting.Tenants.MediaStorageManagement.Tests.UI.csproj b/Lombiq.Hosting.Tenants.MediaStorageManagement.Tests.UI/Lombiq.Hosting.Tenants.MediaStorageManagement.Tests.UI.csproj index df4962f..62eb850 100644 --- a/Lombiq.Hosting.Tenants.MediaStorageManagement.Tests.UI/Lombiq.Hosting.Tenants.MediaStorageManagement.Tests.UI.csproj +++ b/Lombiq.Hosting.Tenants.MediaStorageManagement.Tests.UI/Lombiq.Hosting.Tenants.MediaStorageManagement.Tests.UI.csproj @@ -32,7 +32,7 @@ - +