Add output schema registry and public contract docs
This commit is contained in:
@@ -99,6 +99,33 @@ func TestProcessSuccessWithoutOutputSubprocess(t *testing.T) {
|
||||
assertJSONSemanticallyEqual(t, inputBytes, []byte(result.stdout))
|
||||
}
|
||||
|
||||
func TestProcessSuccessWithAuditaV1OutputSchemaSubprocess(t *testing.T) {
|
||||
result := runCLISubprocess(
|
||||
t,
|
||||
"process",
|
||||
fixturePath("tiny_transcript.json"),
|
||||
"--glossary",
|
||||
fixturePath("tiny_glossary.yaml"),
|
||||
"--output-schema",
|
||||
"audita-v1",
|
||||
)
|
||||
if result.exitCode != 0 {
|
||||
t.Fatalf("expected exit 0, got %d stderr=%q", result.exitCode, result.stderr)
|
||||
}
|
||||
if result.stderr != "" {
|
||||
t.Fatalf("expected empty stderr on success, got %q", result.stderr)
|
||||
}
|
||||
var out struct {
|
||||
Schema string `json:"schema"`
|
||||
}
|
||||
if err := json.Unmarshal([]byte(result.stdout), &out); err != nil {
|
||||
t.Fatalf("expected valid audita-v1 JSON output: %v", err)
|
||||
}
|
||||
if out.Schema != "audita-v1" {
|
||||
t.Fatalf("expected audita-v1 schema, got %q", out.Schema)
|
||||
}
|
||||
}
|
||||
|
||||
func TestProcessFailureMissingTranscriptSubprocess(t *testing.T) {
|
||||
result := runCLISubprocess(t, "process", "--glossary", fixturePath("tiny_glossary.yaml"))
|
||||
if result.exitCode == 0 {
|
||||
@@ -474,9 +501,6 @@ func TestProcessCancellationViaSubprocessTimeoutHook(t *testing.T) {
|
||||
"--work-dir-retention",
|
||||
"always",
|
||||
)
|
||||
if result.exitCode == 0 {
|
||||
t.Fatalf("expected nonzero exit code")
|
||||
}
|
||||
if result.stdout != "" {
|
||||
t.Fatalf("expected empty stdout on failure, got %q", result.stdout)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user