Skip to content

Commit

Permalink
sql: skip pgbench if not on PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
dt committed Nov 7, 2016
1 parent eee24c0 commit 1957266
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/sql/pgbench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"fmt"
"math/rand"
"net/url"
osexec "os/exec"
"testing"
"time"

Expand Down Expand Up @@ -84,6 +85,9 @@ func runPgbenchQueryParallel(b *testing.B, db *gosql.DB) {
}

func execPgbench(b *testing.B, pgUrl url.URL) {
if _, err := osexec.LookPath("pgbench"); err != nil {
b.Skip("pgbench is not available on PATH")
}
c, err := pgbench.SetupExec(pgUrl, "bench", 20000, b.N)
if err != nil {
b.Fatal(err)
Expand Down

0 comments on commit 1957266

Please sign in to comment.