X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/29bd6c67e371a5ee6396e117956599eea572ac55..3d2b1ba10a5739e49d26658fa7aaf090dbd6ed44:/sdk/go/arvadostest/db.go diff --git a/sdk/go/arvadostest/db.go b/sdk/go/arvadostest/db.go index 41ecfacc48..d39f3c6fcb 100644 --- a/sdk/go/arvadostest/db.go +++ b/sdk/go/arvadostest/db.go @@ -5,11 +5,10 @@ package arvadostest import ( - "context" - - "git.arvados.org/arvados.git/lib/ctrlctx" "git.arvados.org/arvados.git/sdk/go/arvados" "github.com/jmoiron/sqlx" + + // sqlx needs lib/pq to talk to PostgreSQL _ "github.com/lib/pq" "gopkg.in/check.v1" ) @@ -20,14 +19,3 @@ func DB(c *check.C, cluster *arvados.Cluster) *sqlx.DB { c.Assert(err, check.IsNil) return db } - -// TransactionContext returns a context suitable for running a test -// case in a new transaction, and a rollback func which the caller -// should call after the test. -func TransactionContext(c *check.C, db *sqlx.DB) (ctx context.Context, rollback func()) { - tx, err := db.Beginx() - c.Assert(err, check.IsNil) - return ctrlctx.NewWithTransaction(context.Background(), tx), func() { - c.Check(tx.Rollback(), check.IsNil) - } -}