fix(dredd): do not clean postgres db

This commit is contained in:
Denis Gukov 2022-11-20 00:45:54 +05:00
parent 23e6402d31
commit 16ce9b80a1

View File

@ -8,6 +8,7 @@ import (
"github.com/ansible-semaphore/semaphore/db/factory"
"github.com/ansible-semaphore/semaphore/db/sql"
"github.com/ansible-semaphore/semaphore/util"
"github.com/go-gorp/gorp/v3"
"github.com/snikch/goodman/transaction"
"math/rand"
"os"
@ -64,6 +65,10 @@ func truncateAll() {
case *bolt.BoltDb:
// Do nothing
case *sql.SqlDb:
switch store.(*sql.SqlDb).Sql().Dialect.(type) {
case gorp.PostgresDialect:
// Do nothing
case gorp.MySQLDialect:
tx, err := store.(*sql.SqlDb).Sql().Begin()
if err != nil {
panic(err)
@ -82,6 +87,7 @@ func truncateAll() {
}
}
}
}
func removeTestRunnerUser(transactions []*transaction.Transaction) {
dbConnect()