test: align thothctl envelope tests with the operator contract
This commit is contained in:
@@ -53,9 +53,9 @@ func TestExecuteSuggestFksStreamsSQLFileContentsOnStdin(t *testing.T) {
|
|||||||
if err := json.Unmarshal([]byte(stdin), &envelope); err != nil {
|
if err := json.Unmarshal([]byte(stdin), &envelope); err != nil {
|
||||||
t.Fatalf("stdin JSON = %q, err=%v", stdin, err)
|
t.Fatalf("stdin JSON = %q, err=%v", stdin, err)
|
||||||
}
|
}
|
||||||
sqlFiles, ok := envelope["sqlFiles"].([]any)
|
sqlFiles, ok := envelope["fromSql"].([]any)
|
||||||
if !ok || len(sqlFiles) != 1 {
|
if !ok || len(sqlFiles) != 1 {
|
||||||
t.Fatalf("sqlFiles = %#v", envelope["sqlFiles"])
|
t.Fatalf("sqlFiles = %#v", envelope["fromSql"])
|
||||||
}
|
}
|
||||||
file, ok := sqlFiles[0].(map[string]any)
|
file, ok := sqlFiles[0].(map[string]any)
|
||||||
if !ok || file["contents"] != "select 1;\n" {
|
if !ok || file["contents"] != "select 1;\n" {
|
||||||
@@ -112,7 +112,7 @@ func TestExecuteSchemaCheckStreamsAnnotationContentOnStdin(t *testing.T) {
|
|||||||
if err := json.Unmarshal([]byte(stdin), &envelope); err != nil {
|
if err := json.Unmarshal([]byte(stdin), &envelope); err != nil {
|
||||||
t.Fatalf("stdin JSON = %q, err=%v", stdin, err)
|
t.Fatalf("stdin JSON = %q, err=%v", stdin, err)
|
||||||
}
|
}
|
||||||
if envelope["annotations"] != "reviewed: []\n" || envelope["reviewedCandidates"] != "sha256:"+strings.Repeat("c", 64) {
|
if envelope["annotationsYaml"] != "reviewed: []\n" || envelope["reviewedCandidatesDigest"] != "sha256:"+strings.Repeat("c", 64) {
|
||||||
t.Fatalf("annotation envelope = %#v", envelope)
|
t.Fatalf("annotation envelope = %#v", envelope)
|
||||||
}
|
}
|
||||||
if _, exists := envelope["annotationsPath"]; exists {
|
if _, exists := envelope["annotationsPath"]; exists {
|
||||||
|
|||||||
Reference in New Issue
Block a user