From 109899f9f8c61b6132c77d4498fd4ee93958d4df Mon Sep 17 00:00:00 2001 From: Bel LaPointe <153096461+breel-render@users.noreply.github.com> Date: Fri, 12 Apr 2024 14:32:36 -0600 Subject: [PATCH] split postgres integration test as -tags=postgres --- driver_integration_test.go | 22 ++++++++++++++++++++++ driver_test.go | 16 ---------------- 2 files changed, 22 insertions(+), 16 deletions(-) create mode 100644 driver_integration_test.go diff --git a/driver_integration_test.go b/driver_integration_test.go new file mode 100644 index 0000000..84a0da0 --- /dev/null +++ b/driver_integration_test.go @@ -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) +} diff --git a/driver_test.go b/driver_test.go index 4944492..25abd9f 100644 --- a/driver_test.go +++ b/driver_test.go @@ -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()) }