Skip to content

Commit

Permalink
test: move all db tests to dbtest package (#251)
Browse files Browse the repository at this point in the history
prerequisite before moving to a separate go module. Tests, which were
not executed in a real db were kept in the same place as before
  • Loading branch information
slsyy authored Jan 2, 2025
1 parent 3e80dba commit ffb65a0
Show file tree
Hide file tree
Showing 34 changed files with 570 additions and 559 deletions.
2 changes: 1 addition & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ tasks:
docker:test:
cmds:
- docker compose down -v --remove-orphans
- docker compose run testfixtures go test -v -tags 'postgresql sqlite mysql sqlserver cockroachdb clickhouse spanner'
- docker compose run testfixtures go test -v -tags 'postgresql sqlite mysql sqlserver cockroachdb clickhouse spanner' ./...
2 changes: 1 addition & 1 deletion clickhouse_test.go → dbtests/clickhouse_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//go:build clickhouse

package testfixtures
package dbtests

import (
"os"
Expand Down
7 changes: 4 additions & 3 deletions cockroachdb_test.go → dbtests/cockroachdb_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
//go:build cockroachdb

package testfixtures
package dbtests

import (
"os"
"testing"

"github.com/go-testfixtures/testfixtures/v3"
_ "github.com/jackc/pgx/v4/stdlib"
_ "github.com/lib/pq"
)
Expand All @@ -18,8 +19,8 @@ func TestCockroachDB(t *testing.T) {
t,
db,
dialect,
DangerousSkipTestDatabaseCheck(),
UseDropConstraint(),
testfixtures.DangerousSkipTestDatabaseCheck(),
testfixtures.UseDropConstraint(),
)
}
}
Loading

0 comments on commit ffb65a0

Please sign in to comment.