split postgres integration test as -tags=postgres

main
Bel LaPointe 2024-04-12 14:32:36 -06:00
parent 20a9589eb8
commit 109899f9f8
2 changed files with 22 additions and 16 deletions

View File

@ -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)
}

View File

@ -4,26 +4,10 @@ import (
"context" "context"
"errors" "errors"
"io" "io"
"os"
"testing" "testing"
"time" "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) { func TestDriverRAM(t *testing.T) {
testDriver(t, NewRAM()) testDriver(t, NewRAM())
} }