Skip to content

Commit 2ba5ef5

Browse files
committed
chore: fix cmd test
1 parent 513d76b commit 2ba5ef5

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

cmd/dump/dump_integration_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func runTenantSchemaTest(t *testing.T, testDataDir string) {
114114
defer containerInfo.Terminate(ctx, t)
115115

116116
// Load public schema types first
117-
publicSQL, err := os.ReadFile(fmt.Sprintf("../../testdata/%s/public.sql", testDataDir))
117+
publicSQL, err := os.ReadFile(fmt.Sprintf("../../testdata/dump/%s/public.sql", testDataDir))
118118
if err != nil {
119119
t.Fatalf("Failed to read public.sql: %v", err)
120120
}
@@ -134,7 +134,7 @@ func runTenantSchemaTest(t *testing.T, testDataDir string) {
134134
}
135135

136136
// Read the tenant SQL
137-
tenantSQL, err := os.ReadFile(fmt.Sprintf("../../testdata/%s/pgschema.sql", testDataDir))
137+
tenantSQL, err := os.ReadFile(fmt.Sprintf("../../testdata/dump/%s/pgschema.sql", testDataDir))
138138
if err != nil {
139139
t.Fatalf("Failed to read tenant.sql: %v", err)
140140
}
@@ -187,7 +187,7 @@ func runTenantSchemaTest(t *testing.T, testDataDir string) {
187187
}
188188

189189
// Read expected output
190-
expectedBytes, err := os.ReadFile(fmt.Sprintf("../../testdata/%s/pgschema.sql", testDataDir))
190+
expectedBytes, err := os.ReadFile(fmt.Sprintf("../../testdata/dump/%s/pgschema.sql", testDataDir))
191191
if err != nil {
192192
t.Fatalf("Failed to read expected output: %v", err)
193193
}

cmd/root_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func TestRootCommand(t *testing.T) {
1818
}
1919

2020
output := buf.String()
21-
if !strings.Contains(output, "A simple CLI tool with version information") {
21+
if !strings.Contains(output, "Declarative schema migration for Postgres") {
2222
t.Errorf("expected help output to contain description, got: %s", output)
2323
}
2424
}
@@ -35,15 +35,15 @@ func TestRootCommandWithoutArgs(t *testing.T) {
3535
}
3636

3737
output := buf.String()
38-
if !strings.Contains(output, "A simple CLI tool with version information") {
38+
if !strings.Contains(output, "Declarative schema migration for Postgres") {
3939
t.Errorf("expected output to contain description, got: %s", output)
4040
}
4141
}
4242

4343
func TestRootCommandHasSubcommands(t *testing.T) {
4444
commands := RootCmd.Commands()
4545

46-
expectedCommands := []string{"version", "dump", "plan"}
46+
expectedCommands := []string{"dump", "plan", "apply"}
4747
commandNames := make([]string, len(commands))
4848
for i, cmd := range commands {
4949
commandNames[i] = cmd.Name()

0 commit comments

Comments
 (0)