Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/NeoReports.Core.UnitTests/ErrorScrubTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ private static async Task<ReportRunResult> RunWithReadFailure(Exception toThrow)
.OnFailure(f => f.AbortReport())
.Build();

var execution = new ReportExecutionContext("job", "r", null, NullLogger.Instance, CancellationToken.None);
var execution = new ReportExecutionContext(Guid.NewGuid().ToString("N"), "r", null, NullLogger.Instance, CancellationToken.None);
return await ReportRunner.ExecuteAsync(report, execution, new EmptyServiceProvider(), CancellationToken.None);
}

Expand Down Expand Up @@ -61,7 +61,7 @@ public async Task Skip_strategy_read_failure_also_scrubs_the_driver_message()
.OnFailure(f => f.SkipBatchAndLog())
.Build();

var execution = new ReportExecutionContext("job", "r", null, NullLogger.Instance, CancellationToken.None);
var execution = new ReportExecutionContext(Guid.NewGuid().ToString("N"), "r", null, NullLogger.Instance, CancellationToken.None);
ReportRunResult result = await ReportRunner.ExecuteAsync(report, execution, new EmptyServiceProvider(), CancellationToken.None);

result.Status.ShouldBe(ReportRunStatus.Failed);
Expand Down
9 changes: 6 additions & 3 deletions tests/NeoReports.Core.UnitTests/ObservabilityTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ private static CompiledReport Build(FakeBatchSource<Sale> source, FakeWriterFact
public async Task Aborted_run_logs_an_error_and_correlates_the_scope_with_the_job()
{
var logger = new CapturingLogger();
var jobId = "job-123";
// A unique job id per test: the runner writes its output under a temp dir keyed on the job id
// (Path.Combine(GetTempPath(), "neoreports", jobId)), so a fixed id would let parallel test
// classes collide on — and clean up — each other's files (an intermittent FileNotFound).
var jobId = Guid.NewGuid().ToString("N");
var execution = new ReportExecutionContext(jobId, "sales", null, logger, CancellationToken.None);

var report = Build(
Expand All @@ -55,7 +58,7 @@ public async Task Aborted_run_logs_an_error_and_correlates_the_scope_with_the_jo
public async Task Aborted_read_failure_also_logs_an_error()
{
var logger = new CapturingLogger();
var execution = new ReportExecutionContext("job", "sales", null, logger, CancellationToken.None);
var execution = new ReportExecutionContext(Guid.NewGuid().ToString("N"), "sales", null, logger, CancellationToken.None);

// Fails the first read definitively (no retry configured), so the run aborts on the read path.
var source = new FakeBatchSource<Sale>(new[] { Page(1) }, new Dictionary<int, int> { [1] = 1 });
Expand All @@ -71,7 +74,7 @@ public async Task Aborted_read_failure_also_logs_an_error()
public async Task Successful_run_logs_no_error()
{
var logger = new CapturingLogger();
var execution = new ReportExecutionContext("job", "sales", null, logger, CancellationToken.None);
var execution = new ReportExecutionContext(Guid.NewGuid().ToString("N"), "sales", null, logger, CancellationToken.None);

var report = Build(new FakeBatchSource<Sale>(new[] { Page(1, 2) }), new FakeWriterFactory());

Expand Down