Commit 3632e9c7 by Mario Trangoni

pkg/tsdb/mysql/mysql_test.go: pass context.Background() instead of nil

See,
$ gometalinter --vendor --disable-all --enable=megacheck --disable=gotype --deadline 6m ./...
pkg/tsdb/mysql/mysql_test.go:132:33:warning: do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:220:33:warning: do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:267:33:warning: do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:330:34:warning: do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:355:33:warning: do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:381:33:warning: do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:476:33:warning: do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:498:33:warning: do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:520:33:warning: do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:542:33:warning: do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:564:33:warning: do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:586:33:warning: do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:608:33:warning: do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:630:33:warning: do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:652:33:warning: do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:674:33:warning: do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:696:33:warning: do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:719:33:warning: do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:744:33:warning: do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:805:33:warning: do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:828:33:warning: do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:854:33:warning: do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:884:33:warning: do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:914:33:warning: do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:944:33:warning: do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:972:33:warning: do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
pkg/tsdb/mysql/mysql_test.go:1000:33:warning: do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use (SA1012) (megacheck)
parent 0f25dec1
package mysql package mysql
import ( import (
"context"
"fmt" "fmt"
"math/rand" "math/rand"
"strings" "strings"
...@@ -129,7 +130,7 @@ func TestMySQL(t *testing.T) { ...@@ -129,7 +130,7 @@ func TestMySQL(t *testing.T) {
}, },
} }
resp, err := endpoint.Query(nil, nil, query) resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil) So(err, ShouldBeNil)
queryResult := resp.Results["A"] queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil) So(queryResult.Error, ShouldBeNil)
...@@ -217,7 +218,7 @@ func TestMySQL(t *testing.T) { ...@@ -217,7 +218,7 @@ func TestMySQL(t *testing.T) {
}, },
} }
resp, err := endpoint.Query(nil, nil, query) resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil) So(err, ShouldBeNil)
queryResult := resp.Results["A"] queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil) So(queryResult.Error, ShouldBeNil)
...@@ -264,7 +265,7 @@ func TestMySQL(t *testing.T) { ...@@ -264,7 +265,7 @@ func TestMySQL(t *testing.T) {
}, },
} }
resp, err := endpoint.Query(nil, nil, query) resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil) So(err, ShouldBeNil)
queryResult := resp.Results["A"] queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil) So(queryResult.Error, ShouldBeNil)
...@@ -327,7 +328,7 @@ func TestMySQL(t *testing.T) { ...@@ -327,7 +328,7 @@ func TestMySQL(t *testing.T) {
}, },
} }
resp, err := endpoint.Query(nil, nil, query) resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil) So(err, ShouldBeNil)
queryResult := resp.Results["A"] queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil) So(queryResult.Error, ShouldBeNil)
...@@ -352,7 +353,7 @@ func TestMySQL(t *testing.T) { ...@@ -352,7 +353,7 @@ func TestMySQL(t *testing.T) {
}, },
} }
resp, err := endpoint.Query(nil, nil, query) resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil) So(err, ShouldBeNil)
queryResult := resp.Results["A"] queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil) So(queryResult.Error, ShouldBeNil)
...@@ -378,7 +379,7 @@ func TestMySQL(t *testing.T) { ...@@ -378,7 +379,7 @@ func TestMySQL(t *testing.T) {
}, },
} }
resp, err := endpoint.Query(nil, nil, query) resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil) So(err, ShouldBeNil)
queryResult := resp.Results["A"] queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil) So(queryResult.Error, ShouldBeNil)
...@@ -473,7 +474,7 @@ func TestMySQL(t *testing.T) { ...@@ -473,7 +474,7 @@ func TestMySQL(t *testing.T) {
}, },
} }
resp, err := endpoint.Query(nil, nil, query) resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil) So(err, ShouldBeNil)
queryResult := resp.Results["A"] queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil) So(queryResult.Error, ShouldBeNil)
...@@ -495,7 +496,7 @@ func TestMySQL(t *testing.T) { ...@@ -495,7 +496,7 @@ func TestMySQL(t *testing.T) {
}, },
} }
resp, err := endpoint.Query(nil, nil, query) resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil) So(err, ShouldBeNil)
queryResult := resp.Results["A"] queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil) So(queryResult.Error, ShouldBeNil)
...@@ -517,7 +518,7 @@ func TestMySQL(t *testing.T) { ...@@ -517,7 +518,7 @@ func TestMySQL(t *testing.T) {
}, },
} }
resp, err := endpoint.Query(nil, nil, query) resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil) So(err, ShouldBeNil)
queryResult := resp.Results["A"] queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil) So(queryResult.Error, ShouldBeNil)
...@@ -539,7 +540,7 @@ func TestMySQL(t *testing.T) { ...@@ -539,7 +540,7 @@ func TestMySQL(t *testing.T) {
}, },
} }
resp, err := endpoint.Query(nil, nil, query) resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil) So(err, ShouldBeNil)
queryResult := resp.Results["A"] queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil) So(queryResult.Error, ShouldBeNil)
...@@ -561,7 +562,7 @@ func TestMySQL(t *testing.T) { ...@@ -561,7 +562,7 @@ func TestMySQL(t *testing.T) {
}, },
} }
resp, err := endpoint.Query(nil, nil, query) resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil) So(err, ShouldBeNil)
queryResult := resp.Results["A"] queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil) So(queryResult.Error, ShouldBeNil)
...@@ -583,7 +584,7 @@ func TestMySQL(t *testing.T) { ...@@ -583,7 +584,7 @@ func TestMySQL(t *testing.T) {
}, },
} }
resp, err := endpoint.Query(nil, nil, query) resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil) So(err, ShouldBeNil)
queryResult := resp.Results["A"] queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil) So(queryResult.Error, ShouldBeNil)
...@@ -605,7 +606,7 @@ func TestMySQL(t *testing.T) { ...@@ -605,7 +606,7 @@ func TestMySQL(t *testing.T) {
}, },
} }
resp, err := endpoint.Query(nil, nil, query) resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil) So(err, ShouldBeNil)
queryResult := resp.Results["A"] queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil) So(queryResult.Error, ShouldBeNil)
...@@ -627,7 +628,7 @@ func TestMySQL(t *testing.T) { ...@@ -627,7 +628,7 @@ func TestMySQL(t *testing.T) {
}, },
} }
resp, err := endpoint.Query(nil, nil, query) resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil) So(err, ShouldBeNil)
queryResult := resp.Results["A"] queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil) So(queryResult.Error, ShouldBeNil)
...@@ -649,7 +650,7 @@ func TestMySQL(t *testing.T) { ...@@ -649,7 +650,7 @@ func TestMySQL(t *testing.T) {
}, },
} }
resp, err := endpoint.Query(nil, nil, query) resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil) So(err, ShouldBeNil)
queryResult := resp.Results["A"] queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil) So(queryResult.Error, ShouldBeNil)
...@@ -671,7 +672,7 @@ func TestMySQL(t *testing.T) { ...@@ -671,7 +672,7 @@ func TestMySQL(t *testing.T) {
}, },
} }
resp, err := endpoint.Query(nil, nil, query) resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil) So(err, ShouldBeNil)
queryResult := resp.Results["A"] queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil) So(queryResult.Error, ShouldBeNil)
...@@ -693,7 +694,7 @@ func TestMySQL(t *testing.T) { ...@@ -693,7 +694,7 @@ func TestMySQL(t *testing.T) {
}, },
} }
resp, err := endpoint.Query(nil, nil, query) resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil) So(err, ShouldBeNil)
queryResult := resp.Results["A"] queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil) So(queryResult.Error, ShouldBeNil)
...@@ -716,7 +717,7 @@ func TestMySQL(t *testing.T) { ...@@ -716,7 +717,7 @@ func TestMySQL(t *testing.T) {
}, },
} }
resp, err := endpoint.Query(nil, nil, query) resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil) So(err, ShouldBeNil)
queryResult := resp.Results["A"] queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil) So(queryResult.Error, ShouldBeNil)
...@@ -741,7 +742,7 @@ func TestMySQL(t *testing.T) { ...@@ -741,7 +742,7 @@ func TestMySQL(t *testing.T) {
}, },
} }
resp, err := endpoint.Query(nil, nil, query) resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil) So(err, ShouldBeNil)
queryResult := resp.Results["A"] queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil) So(queryResult.Error, ShouldBeNil)
...@@ -802,7 +803,7 @@ func TestMySQL(t *testing.T) { ...@@ -802,7 +803,7 @@ func TestMySQL(t *testing.T) {
}, },
} }
resp, err := endpoint.Query(nil, nil, query) resp, err := endpoint.Query(context.Background(), nil, query)
queryResult := resp.Results["Deploys"] queryResult := resp.Results["Deploys"]
So(err, ShouldBeNil) So(err, ShouldBeNil)
So(len(queryResult.Tables[0].Rows), ShouldEqual, 3) So(len(queryResult.Tables[0].Rows), ShouldEqual, 3)
...@@ -825,7 +826,7 @@ func TestMySQL(t *testing.T) { ...@@ -825,7 +826,7 @@ func TestMySQL(t *testing.T) {
}, },
} }
resp, err := endpoint.Query(nil, nil, query) resp, err := endpoint.Query(context.Background(), nil, query)
queryResult := resp.Results["Tickets"] queryResult := resp.Results["Tickets"]
So(err, ShouldBeNil) So(err, ShouldBeNil)
So(len(queryResult.Tables[0].Rows), ShouldEqual, 3) So(len(queryResult.Tables[0].Rows), ShouldEqual, 3)
...@@ -851,7 +852,7 @@ func TestMySQL(t *testing.T) { ...@@ -851,7 +852,7 @@ func TestMySQL(t *testing.T) {
}, },
} }
resp, err := endpoint.Query(nil, nil, query) resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil) So(err, ShouldBeNil)
queryResult := resp.Results["A"] queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil) So(queryResult.Error, ShouldBeNil)
...@@ -881,7 +882,7 @@ func TestMySQL(t *testing.T) { ...@@ -881,7 +882,7 @@ func TestMySQL(t *testing.T) {
}, },
} }
resp, err := endpoint.Query(nil, nil, query) resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil) So(err, ShouldBeNil)
queryResult := resp.Results["A"] queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil) So(queryResult.Error, ShouldBeNil)
...@@ -911,7 +912,7 @@ func TestMySQL(t *testing.T) { ...@@ -911,7 +912,7 @@ func TestMySQL(t *testing.T) {
}, },
} }
resp, err := endpoint.Query(nil, nil, query) resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil) So(err, ShouldBeNil)
queryResult := resp.Results["A"] queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil) So(queryResult.Error, ShouldBeNil)
...@@ -941,7 +942,7 @@ func TestMySQL(t *testing.T) { ...@@ -941,7 +942,7 @@ func TestMySQL(t *testing.T) {
}, },
} }
resp, err := endpoint.Query(nil, nil, query) resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil) So(err, ShouldBeNil)
queryResult := resp.Results["A"] queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil) So(queryResult.Error, ShouldBeNil)
...@@ -969,7 +970,7 @@ func TestMySQL(t *testing.T) { ...@@ -969,7 +970,7 @@ func TestMySQL(t *testing.T) {
}, },
} }
resp, err := endpoint.Query(nil, nil, query) resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil) So(err, ShouldBeNil)
queryResult := resp.Results["A"] queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil) So(queryResult.Error, ShouldBeNil)
...@@ -997,7 +998,7 @@ func TestMySQL(t *testing.T) { ...@@ -997,7 +998,7 @@ func TestMySQL(t *testing.T) {
}, },
} }
resp, err := endpoint.Query(nil, nil, query) resp, err := endpoint.Query(context.Background(), nil, query)
So(err, ShouldBeNil) So(err, ShouldBeNil)
queryResult := resp.Results["A"] queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil) So(queryResult.Error, ShouldBeNil)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment