From 04c72a2c07cbbe2d51ed6d9f5a6478c27f2ec5f5 Mon Sep 17 00:00:00 2001 From: Joe LeGasse Date: Thu, 26 May 2016 11:46:10 -0400 Subject: [PATCH] Correct stress/v2 tests to not depend on $GOPATH The test assumed that you were working within a single directory $GOPATH. `go test` actually sets the current directory to the directory of the package being tested, so the relative path to the test file could be used instead. --- stress/v2/stressql/parser_test.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/stress/v2/stressql/parser_test.go b/stress/v2/stressql/parser_test.go index 104c9df9a3..586be41b2b 100644 --- a/stress/v2/stressql/parser_test.go +++ b/stress/v2/stressql/parser_test.go @@ -1,18 +1,10 @@ package stressql -import ( - "fmt" - "os" - "testing" -) +import "testing" // Pulls the default configFile and makes sure it parses func TestParseStatements(t *testing.T) { - gopath := os.Getenv("GOPATH") - if gopath == "" { - t.Error("$GOPATH not set") - } - stmts, err := ParseStatements(fmt.Sprintf("%v/src/github.com/influxdata/influxdb/stress/v2/file.iql", gopath)) + stmts, err := ParseStatements("../file.iql") if err != nil { t.Error(err) }