mirror of
https://github.com/VinGarcia/ksql.git
synced 2025-05-06 15:39:48 +00:00
Refactor TestTransaction() so its decoupled from the adapters
This commit is contained in:
parent
90f63e5f14
commit
cea28ace2b
16
ksql_test.go
16
ksql_test.go
@ -2069,6 +2069,21 @@ func QueryChunksTest(
|
|||||||
|
|
||||||
func TestTransaction(t *testing.T) {
|
func TestTransaction(t *testing.T) {
|
||||||
for _, config := range supportedConfigs {
|
for _, config := range supportedConfigs {
|
||||||
|
TransactionTest(t,
|
||||||
|
config,
|
||||||
|
func(t *testing.T) (DBAdapter, io.Closer) {
|
||||||
|
db, close := connectDB(t, config)
|
||||||
|
return db, close
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TransactionTest(
|
||||||
|
t *testing.T,
|
||||||
|
config testConfig,
|
||||||
|
newDBAdapter func(t *testing.T) (DBAdapter, io.Closer),
|
||||||
|
) {
|
||||||
t.Run(config.driver, func(t *testing.T) {
|
t.Run(config.driver, func(t *testing.T) {
|
||||||
t.Run("should query a single row correctly", func(t *testing.T) {
|
t.Run("should query a single row correctly", func(t *testing.T) {
|
||||||
err := createTables(config.driver)
|
err := createTables(config.driver)
|
||||||
@ -2134,7 +2149,6 @@ func TestTransaction(t *testing.T) {
|
|||||||
assert.Equal(t, []User{u1, u2}, users)
|
assert.Equal(t, []User{u1, u2}, users)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestScanRows(t *testing.T) {
|
func TestScanRows(t *testing.T) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user