fix(cv-import): bound source retention and guard worker recovery
This commit is contained in:
@@ -19,6 +19,23 @@ namespace JobTrackerApi.Tests;
|
||||
|
||||
public sealed class CvProcessingOperationTests
|
||||
{
|
||||
[Fact]
|
||||
public async Task Cancellation_of_an_expired_import_operation_cannot_resurrect_its_review()
|
||||
{
|
||||
await using var fixture = await Fixture.CreateAsync();
|
||||
await fixture.SeedUserAsync();
|
||||
await using var scope = fixture.Provider.CreateAsyncScope();
|
||||
using var owner = scope.ServiceProvider.GetRequiredService<CurrentUserService>().UseBackgroundUser("user-1");
|
||||
var response = Response(await CreateController(scope.ServiceProvider).Upload(File()));
|
||||
var db = scope.ServiceProvider.GetRequiredService<JobTrackerContext>();
|
||||
var run = await db.CvExtractionRuns.SingleAsync();
|
||||
run.ParserVersion = ProfileCvController.DocumentParserVersion;
|
||||
run.Status = "expired";
|
||||
await db.SaveChangesAsync();
|
||||
Assert.True(await scope.ServiceProvider.GetRequiredService<UserOperationStore>().RequestCancellationAsync(response.Operation!.Id, default));
|
||||
await db.Entry(run).ReloadAsync();
|
||||
Assert.Equal("expired", run.Status);
|
||||
}
|
||||
[Fact]
|
||||
public async Task Upload_is_durable_idempotent_and_stops_at_review_gate()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user