Add PoC smoke verification
This commit is contained in:
38
TornadoAce_CJOnStyle.SmokeTests/Program.cs
Normal file
38
TornadoAce_CJOnStyle.SmokeTests/Program.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System.Text.Json;
|
||||
using TornadoAce_CJOnStyle.Services;
|
||||
|
||||
var workspace = AutomationWorkspace.CreateDemo();
|
||||
Require(workspace.CueSheets.Count == 3, "Expected 3 cue sheet records.");
|
||||
Require(workspace.ErpSchedules.Count == 3, "Expected 3 ERP schedule records.");
|
||||
Require(workspace.ActiveTemplate.Mappings.Count == 5, "Expected 5 field mappings.");
|
||||
|
||||
var engine = new PocAutomationEngine(workspace);
|
||||
var result = engine.RunFullPoc(0, workspace.ActiveTemplate);
|
||||
|
||||
Require(result.Selection.Record.CueSheetId == "CJ-20260817-001", "Unexpected selected cue sheet.");
|
||||
Require(result.Schedule?.ProgramCode == "PGM-CHOI-0900", "ERP schedule was not matched.");
|
||||
Require(result.GeneratedScene.VisibleTextObjects.Count == 5, "Scene snapshot did not include all visible text objects.");
|
||||
Require(result.MappingValidations.All(validation => validation.Status == "통과"), "Mapping profile validation failed.");
|
||||
Require(result.AdapterChecks.Count >= 3, "Tornado adapter checks were not produced.");
|
||||
Require(result.InspectionSummary.Results.Count == workspace.CueSheets.Count, "Inspection did not cover all cue sheets.");
|
||||
Require(result.InspectionSummary.ReviewCount == 2, "Expected 2 inspection review candidates.");
|
||||
Require(result.LlmReviewRequests.Count == 2, "Expected 2 LLM review candidates.");
|
||||
|
||||
var logPath = new PocRunLogWriter().Write(result);
|
||||
Require(File.Exists(logPath), "PoC audit log was not written.");
|
||||
|
||||
using var logDocument = JsonDocument.Parse(File.ReadAllText(logPath));
|
||||
var root = logDocument.RootElement;
|
||||
Require(root.GetProperty("cueSheetId").GetString() == result.Selection.Record.CueSheetId, "Log cue sheet id mismatch.");
|
||||
Require(root.GetProperty("llmRequestCount").GetInt32() == result.LlmReviewRequests.Count, "Log LLM request count mismatch.");
|
||||
|
||||
Console.WriteLine("PoC smoke verification passed.");
|
||||
Console.WriteLine(logPath);
|
||||
|
||||
static void Require(bool condition, string message)
|
||||
{
|
||||
if (!condition)
|
||||
{
|
||||
throw new InvalidOperationException(message);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
|
||||
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Platforms>x64</Platforms>
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
<SelfContained>true</SelfContained>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\TornadoAce_CJOnStyle\TornadoAce_CJOnStyle.csproj" />
|
||||
<Content Include="..\TornadoAce_CJOnStyle\Data\PocWorkspace.json" Link="Data\PocWorkspace.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user