split postgres integration test as -tags=postgres
parent
20a9589eb8
commit
109899f9f8
|
|
@ -0,0 +1,22 @@
|
|||
//go:build postgres
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestPostgres(t *testing.T) {
|
||||
ctx, can := context.WithTimeout(context.Background(), time.Second*15)
|
||||
defer can()
|
||||
|
||||
conn := os.Getenv("INTEGRATION_POSTGRES_CONN")
|
||||
pg, err := NewPostgres(ctx, conn)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
testDriver(t, pg)
|
||||
}
|
||||
|
|
@ -4,26 +4,10 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestPostgres(t *testing.T) {
|
||||
ctx, can := context.WithTimeout(context.Background(), time.Second*15)
|
||||
defer can()
|
||||
|
||||
conn := os.Getenv("INTEGRATION_POSTGRES_CONN")
|
||||
if conn == "" {
|
||||
t.Skip()
|
||||
}
|
||||
pg, err := NewPostgres(ctx, conn)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
testDriver(t, pg)
|
||||
}
|
||||
|
||||
func TestDriverRAM(t *testing.T) {
|
||||
testDriver(t, NewRAM())
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue