Skip to content

Commit

Permalink
fix test due to cmd would return error on failures now; previously cl…
Browse files Browse the repository at this point in the history
…i would not return error
  • Loading branch information
shijiesheng committed Sep 19, 2024
1 parent 1d13d13 commit b5fe0a4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tools/common/schema/test/setuptest.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ func (tb *SetupSchemaTestBase) TearDownSuiteBase() {
// RunSetupTest exercises the SetupSchema task
func (tb *SetupSchemaTestBase) RunSetupTest(
app *cli.App, db DB, dbNameFlag string, sqlFileContent string, expectedTables []string) {
// test command fails without required arguments
tb.NoError(app.Run([]string{"./tool", dbNameFlag, tb.DBName, "-q", "setup-schema"}))
tb.Error(app.Run([]string{"./tool", dbNameFlag, tb.DBName, "setup-schema"}), "test command fails without required arguments")
tables, err := db.ListTables()
tb.NoError(err)
tb.Empty(tables)
Expand All @@ -88,8 +87,7 @@ func (tb *SetupSchemaTestBase) RunSetupTest(
_, err = sqlFile.WriteString(sqlFileContent)
tb.NoError(err)

// make sure command doesn't succeed without version or disable-version
tb.NoError(app.Run([]string{"./tool", dbNameFlag, tb.DBName, "-q", "setup-schema", "-f", sqlFile.Name()}))
tb.Error(app.Run([]string{"./tool", dbNameFlag, tb.DBName, "setup-schema", "-f", sqlFile.Name()}), "make sure command doesn't succeed without version or disable-version")
tables, err = db.ListTables()
tb.NoError(err)
tb.Empty(tables)
Expand Down

0 comments on commit b5fe0a4

Please sign in to comment.