Skip to content

Commit

Permalink
fixup! Run postgres datastore tests with pgbouncer
Browse files Browse the repository at this point in the history
  • Loading branch information
bradengroom committed Oct 23, 2023
1 parent 37e949e commit d8023cb
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions magefiles/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ func (t Test) All() error {
ds := Testds{}
c := Testcons{}
mg.Deps(t.Unit, t.Integration, t.Image, t.Analyzers,
ds.Crdb, ds.Postgres, ds.Spanner, ds.Mysql,
c.Crdb, c.Spanner, c.Postgres, c.Mysql)
ds.Crdb, ds.Postgres, ds.Pgbouncer, ds.Spanner, ds.Mysql,
c.Crdb, c.Spanner, c.Postgres, c.Pgbouncer, c.Mysql)
return nil
}

Expand Down Expand Up @@ -108,15 +108,24 @@ func (Testcons) Postgres() error {
return consistencyTest("postgres")
}

// Pgbouncer runs consistency tests for postgres fronted with pgbouncer
func (Testcons) Pgbouncer() error {
return consistencyTest("postgres", "-enablePgbouncer")
}

// Mysql Run consistency tests for mysql
func (Testcons) Mysql() error {
return consistencyTest("mysql")
}

func consistencyTest(datastore string) error {
func consistencyTest(datastore string, consFlags ...string) error {
mg.Deps(checkDocker)
return goTest("./internal/services/integrationtesting/...",
args := append([]string{
"-tags", "ci,docker,datastoreconsistency",
"-timeout", "10m",
"-run", fmt.Sprintf("TestConsistencyPerDatastore/%s", datastore))
"-run", fmt.Sprintf("TestConsistencyPerDatastore/%s", datastore),
},
consFlags...,
)
return goTest("./internal/services/integrationtesting/...", args...)
}

0 comments on commit d8023cb

Please sign in to comment.