Skip to content

Commit

Permalink
test: fix test mode flag
Browse files Browse the repository at this point in the history
  • Loading branch information
natesales committed Jun 11, 2023
1 parent 59beac2 commit c35220b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ peeringdb-test-harness:
test-setup: dummy-iface peeringdb-test-harness

test:
go test -v -race -coverprofile=coverage.txt -covermode=atomic ./pkg/... ./cmd/...
export PATHVECTOR_TEST=1 && go test -v -race -coverprofile=coverage.txt -covermode=atomic ./pkg/... ./cmd/...

test-teardown:
pkill -f tests/peeringdb/peeringdb-test-api.py
Expand Down
5 changes: 2 additions & 3 deletions pkg/peeringdb/peeringdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package peeringdb
import (
"encoding/json"
"errors"
"flag"
"fmt"
"io"
"net/http"
Expand All @@ -22,8 +21,8 @@ var Endpoint = ""

func init() {
// Check if running in test
if flag.Lookup("test.v") != nil {
Endpoint = "http://localhost:6000/api"
if os.Getenv("PATHVECTOR_TEST") == "1" {
Endpoint = "http://localhost:5000/api"
}
}

Expand Down

0 comments on commit c35220b

Please sign in to comment.