Skip to content

Commit

Permalink
contrib/go-pg/pg.v10: add INTEGRATION flag check for tests (#921)
Browse files Browse the repository at this point in the history
  • Loading branch information
knusbaum authored May 12, 2021
1 parent 4ba66f6 commit e19dac6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions contrib/go-pg/pg.v10/pg_go_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ package pg

import (
"context"
"fmt"
"os"
"testing"

"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/ext"
Expand All @@ -18,6 +20,15 @@ import (
"github.com/stretchr/testify/require"
)

func TestMain(m *testing.M) {
_, ok := os.LookupEnv("INTEGRATION")
if !ok {
fmt.Println("--- SKIP: to enable integration test, set the INTEGRATION environment variable")
os.Exit(0)
}
os.Exit(m.Run())
}

func TestImplementsHook(t *testing.T) {
var _ pg.QueryHook = (*queryHook)(nil)
}
Expand Down

0 comments on commit e19dac6

Please sign in to comment.