refactor(dotnet): materialize scheduler report artifacts
Validators (Pushes and Pull Requests) / validate-ui-and-storage (push) Successful in 16s
Validators (Pushes and Pull Requests) / validate-core (push) Failing after 1m39s

This commit is contained in:
2026-07-13 01:12:28 +09:00
parent ca3b394ec2
commit 7fa78f4c7c
2 changed files with 106 additions and 6 deletions
@@ -109,6 +109,46 @@ public class SchedulerServiceTests
Assert.Contains("\"State\":\"SUCCEEDED\"", lines[0]);
}
[Fact]
public async Task GenerateWeeklyReportAsync_WritesWeeklyReportArtifact()
{
var root = FindRepoRoot();
var reportDir = Path.Combine(root, "Temp", "scheduler_audit", "reports");
if (Directory.Exists(reportDir))
{
Directory.Delete(reportDir, true);
}
var service = CreateService();
await service.GenerateWeeklyReportAsync();
var reportPath = Path.Combine(reportDir, $"weekly-report-{DateTime.UtcNow:yyyyMMdd}.json");
Assert.True(File.Exists(reportPath));
var text = await File.ReadAllTextAsync(reportPath);
Assert.Contains("\"report_type\": \"weekly-report\"", text);
Assert.Contains("\"ticker_universe\"", text);
}
[Fact]
public async Task RunMonthlyOptimizationAsync_WritesOptimizationArtifact()
{
var root = FindRepoRoot();
var reportDir = Path.Combine(root, "Temp", "scheduler_audit", "reports");
if (Directory.Exists(reportDir))
{
Directory.Delete(reportDir, true);
}
var service = CreateService();
await service.RunMonthlyOptimizationAsync();
var reportPath = Path.Combine(reportDir, $"monthly-optimization-{DateTime.UtcNow:yyyyMMdd}.json");
Assert.True(File.Exists(reportPath));
var text = await File.ReadAllTextAsync(reportPath);
Assert.Contains("\"report_type\": \"monthly-optimization\"", text);
Assert.Contains("\"optimization_scope\"", text);
}
[Fact]
public void LoadTickersFromJson_WhenFileMissing_FallsBackToDefaultUniverse()
{