Skip to content

Commit

Permalink
test(sqlite): run sqlite path tests only in e2e (#1080)
Browse files Browse the repository at this point in the history
  • Loading branch information
steebchen authored Nov 5, 2023
1 parent 13c1d60 commit 6919def
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
9 changes: 7 additions & 2 deletions test/databases/sqlite/checks_nested/default_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
package raw
//go:build e2e
// +build e2e

// package db is only tested in e2e mode as it might conflict when running locally
package db

import (
"context"
"testing"

"github.com/steebchen/prisma-client-go/test"
"github.com/steebchen/prisma-client-go/test/databases/sqlite/checks_nested/prisma"
"github.com/stretchr/testify/assert"
"testing"
)

type cx = context.Context
Expand Down
6 changes: 5 additions & 1 deletion test/databases/sqlite/checks_path/default_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
//go:build e2e
// +build e2e

// package db is only tested in e2e mode as it might conflict when running locally
package db

import (
"context"
"github.com/stretchr/testify/assert"
"testing"

"github.com/steebchen/prisma-client-go/test"
"github.com/stretchr/testify/assert"
)

type cx = context.Context
Expand Down
5 changes: 5 additions & 0 deletions test/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ var Databases = []Database{
const schemaTemplate = "schema.temp.%s.prisma"

func Migrate(t *testing.T, db Database, e engine.Engine, mockDB string) {
t.Helper()
schemaPath := fmt.Sprintf(schemaTemplate, db.Name())

xe := e.(*engine.QueryEngine)
Expand All @@ -59,6 +60,8 @@ func Migrate(t *testing.T, db Database, e engine.Engine, mockDB string) {
}

func Start(t *testing.T, db Database, e engine.Engine, queries []string) string {
t.Helper()

mockDB := db.SetupDatabase(t)
Migrate(t, db, e, mockDB)

Expand Down Expand Up @@ -91,6 +94,8 @@ func Start(t *testing.T, db Database, e engine.Engine, queries []string) string
}

func End(t *testing.T, db Database, e engine.Engine, mockDBName string) {
t.Helper()

defer Teardown(t, db, mockDBName)

if err := e.Disconnect(); err != nil {
Expand Down

0 comments on commit 6919def

Please sign in to comment.