From fbd7bc397bdae1dfd079e1580d1a4f6c59a3b790 Mon Sep 17 00:00:00 2001 From: George Drak Date: Sat, 14 Oct 2023 20:29:39 +0500 Subject: [PATCH] fix(tests): start app in certain scopes --- tests/Sitko.Core.Configuration.Vault.Tests/BaseVaultTest.cs | 6 ++++++ .../BasePostgresStorageTestScope.cs | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/tests/Sitko.Core.Configuration.Vault.Tests/BaseVaultTest.cs b/tests/Sitko.Core.Configuration.Vault.Tests/BaseVaultTest.cs index 007ad84a3..80d54a16a 100644 --- a/tests/Sitko.Core.Configuration.Vault.Tests/BaseVaultTest.cs +++ b/tests/Sitko.Core.Configuration.Vault.Tests/BaseVaultTest.cs @@ -74,6 +74,12 @@ protected override IHostApplicationBuilder ConfigureApplication(IHostApplication { options.Secrets = new List { "NonExistingSecret" }; }); + + public override async Task OnCreatedAsync() + { + await base.OnCreatedAsync(); + await StartApplicationAsync(); + } } public class VaultTestScopeWithValidationFailure : VaultTestScope diff --git a/tests/Sitko.Core.Storage.Metadata.Postgres.Tests/BasePostgresStorageTestScope.cs b/tests/Sitko.Core.Storage.Metadata.Postgres.Tests/BasePostgresStorageTestScope.cs index 0d7270215..e1b2c9d85 100644 --- a/tests/Sitko.Core.Storage.Metadata.Postgres.Tests/BasePostgresStorageTestScope.cs +++ b/tests/Sitko.Core.Storage.Metadata.Postgres.Tests/BasePostgresStorageTestScope.cs @@ -18,6 +18,12 @@ protected override IHostApplicationBuilder ConfigureApplication(IHostApplication moduleOptions.Database = name; }); + public override async Task OnCreatedAsync() + { + await base.OnCreatedAsync(); + await StartApplicationAsync(); + } + protected override async Task OnDisposeAsync() { await base.OnDisposeAsync();