refactor(dotnet): materialize scheduler report artifacts
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user