Improved performance of integration tests.
Some checks failed
ci / build-test (push) Failing after 8m39s

This commit is contained in:
2025-11-02 13:56:34 -05:00
parent b06eadef1d
commit abd5a81e3e
10 changed files with 262 additions and 130 deletions

View File

@@ -4,6 +4,7 @@ using JSMR.Infrastructure.Common.Time;
using JSMR.Infrastructure.Data;
using JSMR.Infrastructure.Ingestion;
using JSMR.Tests.Fixtures;
using Microsoft.EntityFrameworkCore;
using NSubstitute;
using System.Runtime.InteropServices;
@@ -13,9 +14,17 @@ public abstract class IngestionTestsBase(MariaDbContainerFixture container)
{
protected async Task<AppDbContext> GetAppDbContextAsync()
{
return await MariaTestDb.CreateIsolatedAsync(
container.RootConnectionString,
seed: VoiceWorkIngestionSeedData.SeedAsync);
//return await MariaTestDb.CreateIsolatedAsync(
// container.RootConnectionString,
// seed: VoiceWorkIngestionSeedData.SeedAsync);
var newDb = $"t_{DateTime.UtcNow:yyyyMMddHHmmss}_{Guid.NewGuid():N}";
return await MariaDbClone.CloneFromTemplateAsync(
container.RootConnectionString,
container.TemplateDbName,
newDbName: newDb,
seed: VoiceWorkIngestionSeedData.SeedAsync);
}
protected static async Task<VoiceWorkUpsertResult[]> UpsertAsync(AppDbContext dbContext, DateTime dateTime, VoiceWorkIngest[] ingests)