refactor(bootstrap): migrate practice opponents to seed file
Move /practice/info handling out of GlobalsImporter into a dedicated PracticeOpponentImporter that reads a normalized JSON seed file generated by data_dumps/extract/extract-practice-opponents.ps1.
This commit is contained in:
@@ -185,9 +185,14 @@ internal sealed class SVSimTestFactory : WebApplicationFactory<Program>
|
||||
public async Task SeedGlobalsAsync(string? capturesDir = null)
|
||||
{
|
||||
capturesDir ??= Path.Combine(AppContext.BaseDirectory, "Data", "prod-captures");
|
||||
string seedDir = Path.Combine(AppContext.BaseDirectory, "Data", "seeds");
|
||||
using var scope = Services.CreateScope();
|
||||
var ctx = scope.ServiceProvider.GetRequiredService<SVSimDbContext>();
|
||||
await new GlobalsImporter().ImportAllAsync(ctx, capturesDir);
|
||||
// Per-importer seed pipeline runs alongside GlobalsImporter during the migration.
|
||||
// Wired here so SeedGlobalsAsync callers (e.g. PracticeControllerTests) still see
|
||||
// practice-opponent rows after the corresponding block was lifted out of GlobalsImporter.
|
||||
await new PracticeOpponentImporter().ImportAsync(ctx, seedDir);
|
||||
}
|
||||
|
||||
/// <summary>Convenience: bake the X-Test-Viewer-Id header into a fresh client.</summary>
|
||||
|
||||
Reference in New Issue
Block a user