Skip to content

Commit c395a9e

Browse files
test: align migration expectations with schema version 4
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
1 parent cbdd052 commit c395a9e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

cmd/ccg/main_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ func TestRunMigrations_SQLiteDownRestoresNullableColumns(t *testing.T) {
268268
if err != nil {
269269
t.Fatalf("create migrator: %v", err)
270270
}
271-
if err := migrator.Steps(-2); err != nil {
271+
if err := migrator.Steps(-3); err != nil {
272272
t.Fatalf("run down migration: %v", err)
273273
}
274274

@@ -313,7 +313,7 @@ func TestRunMigrations_SQLiteDownFromVersionThreeDropsPolicyTables(t *testing.T)
313313
if err != nil {
314314
t.Fatalf("create migrator: %v", err)
315315
}
316-
if err := migrator.Steps(-1); err != nil {
316+
if err := migrator.Steps(-2); err != nil {
317317
t.Fatalf("run down migration: %v", err)
318318
}
319319

@@ -427,7 +427,7 @@ func TestEnsureSchemaVersion_LogsRuntimeSchemaPassAndFail(t *testing.T) {
427427
t.Fatalf("ensure schema version: %v", err)
428428
}
429429
passLog := logs.String()
430-
for _, want := range []string{"database runtime schema check passed", "driver=sqlite", "required_version=3", "auto_migrated=true"} {
430+
for _, want := range []string{"database runtime schema check passed", "driver=sqlite", "required_version=4", "auto_migrated=true"} {
431431
if !strings.Contains(passLog, want) {
432432
t.Fatalf("expected runtime schema pass log to contain %q, got %q", want, passLog)
433433
}
@@ -441,7 +441,7 @@ func TestEnsureSchemaVersion_LogsRuntimeSchemaPassAndFail(t *testing.T) {
441441
t.Fatal("expected parity failure")
442442
}
443443
failLog := logs.String()
444-
for _, want := range []string{"database runtime schema check failed", "driver=sqlite", "required_version=3", "auto_migrated=false", "error="} {
444+
for _, want := range []string{"database runtime schema check failed", "driver=sqlite", "required_version=4", "auto_migrated=false", "error.message="} {
445445
if !strings.Contains(failLog, want) {
446446
t.Fatalf("expected runtime schema failure log to contain %q, got %q", want, failLog)
447447
}

0 commit comments

Comments
 (0)