Chore: Enable whitespace linter (#25903)

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Arve Knudsen
2020-07-06 20:17:28 +02:00
committed by GitHub
parent 42295898b8
commit 41d432b5ae
189 changed files with 3 additions and 303 deletions
@@ -130,7 +130,6 @@ func (e *ApplicationInsightsDatasource) buildQueries(queries []*tsdb.Query, time
aggregation: insightsJSONModel.Aggregation,
dimensions: insightsJSONModel.Dimensions,
})
}
return applicationInsightsQueries, nil
@@ -121,7 +121,6 @@ func TestApplicationInsightsDatasource(t *testing.T) {
So(queries[0].Target, ShouldEqual, "aggregation=Average&filter=blob+eq+%27%2A%27&interval=PT1M&segment=blob&timespan=2018-03-15T13%3A00%3A00Z%2F2018-03-15T13%3A34%3A00Z")
So(queries[0].Params["filter"][0], ShouldEqual, "blob eq '*'")
})
Convey("and has a dimension filter set to None", func() {
@@ -208,7 +207,6 @@ func TestAppInsightsPluginRoutes(t *testing.T) {
}
})
}
}
func TestInsightsDimensionsUnmarshalJSON(t *testing.T) {
@@ -124,7 +124,6 @@ func valFromLeafAP(ap map[string]interface{}, metric, agg string) (*float64, err
metMap, ok := met.(map[string]interface{})
if !ok {
return nil, fmt.Errorf("unexpected type for additional properties not found in leaf segment, want map[string]interface{}, but got %T", met)
}
metVal, ok := metMap[agg]
if !ok {
@@ -113,10 +113,8 @@ func TestInsightsMetricsResultToFrame(t *testing.T) {
if diff := cmp.Diff(tt.expectedFrame(), frame, data.FrameTestCompareOptions()...); diff != "" {
t.Errorf("Result mismatch (-want +got):\n%s", diff)
}
})
}
}
func loadInsightsMetricsResponse(name string) (MetricsResult, error) {
@@ -154,5 +154,4 @@ func TestPluginRoutes(t *testing.T) {
}
})
}
}
@@ -131,10 +131,8 @@ func TestLogTableToFrame(t *testing.T) {
if diff := cmp.Diff(tt.expectedFrame(), frame, data.FrameTestCompareOptions()...); diff != "" {
t.Errorf("Result mismatch (-want +got):\n%s", diff)
}
})
}
}
func loadLogAnalyticsTestFileWithNumber(name string) (AzureLogAnalyticsResponse, error) {
@@ -89,7 +89,6 @@ func (e *InsightsAnalyticsDatasource) buildQueries(queries []*tsdb.Query, timeRa
qm.Target = qm.Params.Encode()
iaQueries = append(iaQueries, &qm)
}
return iaQueries, nil
-1
View File
@@ -174,7 +174,6 @@ func (s *InsightsDimensions) UnmarshalJSON(data []byte) error {
err := json.Unmarshal(data, &str)
if err != nil {
return fmt.Errorf("could not parse %q as string or array: %w", string(data), err)
}
if str != "" {
*s = InsightsDimensions{str}
-1
View File
@@ -17,7 +17,6 @@ type urlBuilder struct {
// Build checks the metric definition property to see which form of the url
// should be returned
func (ub *urlBuilder) Build() string {
subscription := ub.Subscription
if ub.Subscription == "" {
@@ -8,7 +8,6 @@ import (
func TestURLBuilder(t *testing.T) {
Convey("AzureMonitor URL Builder", t, func() {
Convey("when metric definition is in the short form", func() {
ub := &urlBuilder{
DefaultSubscription: "default-sub",
@@ -459,7 +459,6 @@ func TestCloudMonitoring(t *testing.T) {
verifyDeepLink(dl, expectedTimeSelection, expectedTimeSeriesFilter)
})
})
})
Convey("Parse queries from frontend and build Google Cloud Monitoring API queries", func() {
@@ -675,7 +674,6 @@ func TestCloudMonitoring(t *testing.T) {
res := &tsdb.QueryResult{Meta: simplejson.New(), RefId: "A"}
Convey("and the alias pattern is for metric type, a metric label and a resource label", func() {
query := &cloudMonitoringQuery{AliasBy: "{{metric.type}} - {{metric.label.instance_name}} - {{resource.label.zone}}", GroupBys: []string{"metric.label.instance_name", "resource.label.zone"}}
err = executor.parseResponse(res, data, query)
So(err, ShouldBeNil)
@@ -689,7 +687,6 @@ func TestCloudMonitoring(t *testing.T) {
})
Convey("and the alias pattern is for metric name", func() {
query := &cloudMonitoringQuery{AliasBy: "metric {{metric.name}} service {{metric.service}}", GroupBys: []string{"metric.label.instance_name", "resource.label.zone"}}
err = executor.parseResponse(res, data, query)
So(err, ShouldBeNil)
@@ -142,7 +142,6 @@ func TestCloudWatchQuery(t *testing.T) {
Convey("it is not metric stat", func() {
So(query.isMetricStat(), ShouldBeFalse)
})
})
Convey("and match exact is true", func() {
@@ -158,7 +157,6 @@ func TestCloudWatchQuery(t *testing.T) {
Convey("it is a metric stat", func() {
So(query.isMetricStat(), ShouldBeTrue)
})
})
})
-1
View File
@@ -114,7 +114,6 @@ func TestExecuteStartQuery(t *testing.T) {
assert.Equal(t, expectedResponse, response)
assert.Equal(t, fmt.Errorf("invalid time range: start time must be before end time"), err)
}
func TestHandleStartQuery(t *testing.T) {
@@ -28,7 +28,6 @@ func TestMetricDataQueryBuilder(t *testing.T) {
})
Convey("and query has three dimension values for two given dimension keys", func() {
query := &cloudWatchQuery{
Namespace: "AWS/EC2",
MetricName: "CPUUtilization",
@@ -178,7 +177,6 @@ func TestMetricDataQueryBuilder(t *testing.T) {
res := buildSearchExpression(query, "Average")
So(res, ShouldEqual, `REMOVE_EMPTY(SEARCH('Namespace="AWS/EC2" MetricName="CPUUtilization" "LoadBalancer"=("lb1" OR "lb2" OR "lb3") "InstanceId"', 'Average', 300))`)
})
})
})
@@ -198,7 +196,6 @@ func TestMetricDataQueryBuilder(t *testing.T) {
Convey("it should escape double quotes", func() {
So(res, ShouldContainSubstring, `lb4\"\"`)
})
})
})
}
@@ -43,7 +43,6 @@ func (m mockedRGTA) GetResourcesPages(in *resourcegroupstaggingapi.GetResourcesI
}
func TestCloudWatchMetrics(t *testing.T) {
t.Run("When calling getMetricsForCustomMetrics", func(t *testing.T) {
dsInfo := &DatasourceInfo{
Region: "us-east-1",
@@ -10,7 +10,6 @@ import (
func TestQueryTransformer(t *testing.T) {
Convey("TestQueryTransformer", t, func() {
Convey("when transforming queries", func() {
executor := &CloudWatchExecutor{}
Convey("one cloudwatchQuery is generated when its request query has one stat", func() {
requestQueries := []*requestQuery{
@@ -211,7 +211,6 @@ func TestRequestParser(t *testing.T) {
So(res.Period, ShouldEqual, 86400)
})
})
})
})
}
@@ -158,10 +158,8 @@ func (rp *responseParser) processBuckets(aggs map[string]interface{}, target *Qu
}
}
}
}
return nil
}
func (rp *responseParser) processMetrics(esAgg *simplejson.Json, target *Query, series *tsdb.TimeSeriesSlice, props map[string]string) error {
@@ -424,7 +422,6 @@ func (rp *responseParser) nameSeries(seriesList *tsdb.TimeSeriesSlice, target *Q
for _, series := range *seriesList {
series.Name = rp.getSeriesName(series, target, metricTypeCount)
}
}
var aliasPatternRegex = regexp.MustCompile(`\{\{([\s\S]+?)\}\}`)
@@ -519,7 +516,6 @@ func (rp *responseParser) getSeriesName(series *tsdb.TimeSeries, target *Query,
}
return strings.TrimSpace(name) + " " + metricName
}
func (rp *responseParser) getMetricName(metric string) string {
-1
View File
@@ -92,5 +92,4 @@ func FrameToSeriesSlice(frame *data.Frame) (TimeSeriesSlice, error) {
}
return seriesSlice, nil
}
-16
View File
@@ -8,55 +8,39 @@ import (
func TestGraphiteFunctions(t *testing.T) {
Convey("Testing Graphite Functions", t, func() {
Convey("formatting time range for now", func() {
timeRange := formatTimeRange("now")
So(timeRange, ShouldEqual, "now")
})
Convey("formatting time range for now-1m", func() {
timeRange := formatTimeRange("now-1m")
So(timeRange, ShouldEqual, "-1min")
})
Convey("formatting time range for now-1M", func() {
timeRange := formatTimeRange("now-1M")
So(timeRange, ShouldEqual, "-1mon")
})
Convey("fix interval format in query for 1m", func() {
timeRange := fixIntervalFormat("aliasByNode(hitcount(averageSeries(app.grafana.*.dashboards.views.count), '1m'), 4)")
So(timeRange, ShouldEqual, "aliasByNode(hitcount(averageSeries(app.grafana.*.dashboards.views.count), '1min'), 4)")
})
Convey("fix interval format in query for 1M", func() {
timeRange := fixIntervalFormat("aliasByNode(hitcount(averageSeries(app.grafana.*.dashboards.views.count), '1M'), 4)")
So(timeRange, ShouldEqual, "aliasByNode(hitcount(averageSeries(app.grafana.*.dashboards.views.count), '1mon'), 4)")
})
Convey("should not override query for 1M", func() {
timeRange := fixIntervalFormat("app.grafana.*.dashboards.views.1M.count")
So(timeRange, ShouldEqual, "app.grafana.*.dashboards.views.1M.count")
})
Convey("should not override query for 1m", func() {
timeRange := fixIntervalFormat("app.grafana.*.dashboards.views.1m.count")
So(timeRange, ShouldEqual, "app.grafana.*.dashboards.views.1m.count")
})
})
}
-1
View File
@@ -5,7 +5,6 @@ import (
)
func TestColumnIdentification(t *testing.T) {
t.Run("Test Tag Identification", func(t *testing.T) {
tagNames := []string{"header", "value", "tag"}
for _, item := range tagNames {
-2
View File
@@ -31,7 +31,6 @@ func Query(ctx context.Context, dsInfo *models.DataSource, tsdbQuery *tsdb.TsdbQ
}
for _, query := range tsdbQuery.Queries {
qm, err := GetQueryModelTSDB(query, tsdbQuery.TimeRange, dsInfo)
if err != nil {
tRes.Results[query.RefId] = &tsdb.QueryResult{Error: err}
@@ -82,7 +81,6 @@ func RunnerFromDataSource(dsInfo *models.DataSource) (*Runner, error) {
client: influxdb2.NewClient(url, token),
org: org,
}, nil
}
// backendDataResponseToTSDBResponse takes the SDK's style response and changes it into a
-1
View File
@@ -13,7 +13,6 @@ const variableFilter = `(?m)([a-zA-Z]+)\.([a-zA-Z]+)`
// Interpolate processes macros
func Interpolate(query QueryModel) (string, error) {
flux := query.RawQuery
variableFilterExp, err := regexp.Compile(variableFilter)
-1
View File
@@ -36,7 +36,6 @@ func TestInterpolate(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
query := QueryModel{
RawQuery: tt.before,
Options: options,
-2
View File
@@ -44,7 +44,6 @@ func init() {
}
func (e *InfluxDBExecutor) Query(ctx context.Context, dsInfo *models.DataSource, tsdbQuery *tsdb.TsdbQuery) (*tsdb.Response, error) {
glog.Info("query", "q", tsdbQuery.Queries)
version := dsInfo.JsonData.Get("version").MustString("")
@@ -123,7 +122,6 @@ func (e *InfluxDBExecutor) getQuery(dsInfo *models.DataSource, queries []*tsdb.Q
}
func (e *InfluxDBExecutor) createRequest(dsInfo *models.DataSource, query string) (*http.Request, error) {
u, err := url.Parse(dsInfo.Url)
if err != nil {
return nil, err
-4
View File
@@ -37,7 +37,6 @@ func TestInfluxDB(t *testing.T) {
Convey("has an empty body", func() {
So(req.Body, ShouldEqual, nil)
})
})
Convey("createRequest with POST httpMode", func() {
@@ -60,7 +59,6 @@ func TestInfluxDB(t *testing.T) {
testBody := testBodyValues.Encode()
So(string(body[:]), ShouldEqual, testBody)
})
})
Convey("createRequest with PUT httpMode", func() {
@@ -70,8 +68,6 @@ func TestInfluxDB(t *testing.T) {
Convey("should miserably fail", func() {
So(err, ShouldEqual, ErrInvalidHttpMode)
})
})
})
}
-1
View File
@@ -139,7 +139,6 @@ func (*InfluxdbQueryParser) parseQueryPart(model *simplejson.Json) (*QueryPart,
}
return nil, err
}
qp, err := NewQueryPart(typ, params)
-1
View File
@@ -11,7 +11,6 @@ import (
func TestInfluxdbQueryParser(t *testing.T) {
Convey("Influxdb query parser", t, func() {
parser := &InfluxdbQueryParser{}
dsInfo := &models.DataSource{
JsonData: simplejson.New(),
-1
View File
@@ -93,7 +93,6 @@ func (query *Query) renderSelectors(queryContext *tsdb.TsdbQuery) string {
var selectors []string
for _, sel := range query.Selects {
stk := ""
for _, s := range *sel {
stk = s.Render(query, queryContext, stk)
-3
View File
@@ -11,9 +11,7 @@ import (
)
func TestInfluxdbQueryBuilder(t *testing.T) {
Convey("Influxdb query builder", t, func() {
qp1, _ := NewQueryPart("field", []string{"value"})
qp2, _ := NewQueryPart("mean", []string{})
@@ -202,5 +200,4 @@ func TestInfluxdbQueryBuilder(t *testing.T) {
So(query.renderMeasurement(), ShouldEqual, ` FROM "policy"./apa/`)
})
})
}
-2
View File
@@ -153,7 +153,6 @@ func TestMacroEngine(t *testing.T) {
})
Convey("interpolate __unixEpochGroup function", func() {
sql, err := engine.Interpolate(query, timeRange, "SELECT $__unixEpochGroup(time_column,'5m')")
So(err, ShouldBeNil)
sql2, err := engine.Interpolate(query, timeRange, "SELECT $__unixEpochGroupAlias(time_column,'5m')")
@@ -162,7 +161,6 @@ func TestMacroEngine(t *testing.T) {
So(sql, ShouldEqual, "SELECT FLOOR(time_column/300)*300")
So(sql2, ShouldEqual, sql+" AS [time]")
})
})
Convey("Given a time range between 1960-02-01 07:00 and 1965-02-03 08:00", func() {
-2
View File
@@ -306,7 +306,6 @@ func TestMSSQL(t *testing.T) {
}
So(points[6][0].Valid, ShouldBeFalse)
})
Convey("When doing a metric query using timeGroup and $__interval", func() {
@@ -705,7 +704,6 @@ func TestMSSQL(t *testing.T) {
queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil)
So(queryResult.Meta.Get(sqleng.MetaKeyExecutedQueryString).MustString(), ShouldEqual, "SELECT time FROM metric_values WHERE time > '2018-03-15T12:55:00Z' OR time < '2018-03-15T12:55:00Z' OR 1 < 1521118500 OR 1521118800 > 1 ORDER BY 1")
})
Convey("Given a stored procedure that takes @from and @to in epoch time", func() {
-4
View File
@@ -38,7 +38,6 @@ func TestMacroEngine(t *testing.T) {
})
Convey("interpolate __timeGroup function", func() {
sql, err := engine.Interpolate(query, timeRange, "GROUP BY $__timeGroup(time_column,'5m')")
So(err, ShouldBeNil)
sql2, err := engine.Interpolate(query, timeRange, "GROUP BY $__timeGroupAlias(time_column,'5m')")
@@ -49,7 +48,6 @@ func TestMacroEngine(t *testing.T) {
})
Convey("interpolate __timeGroup function with spaces around arguments", func() {
sql, err := engine.Interpolate(query, timeRange, "GROUP BY $__timeGroup(time_column , '5m')")
So(err, ShouldBeNil)
sql2, err := engine.Interpolate(query, timeRange, "GROUP BY $__timeGroupAlias(time_column , '5m')")
@@ -109,7 +107,6 @@ func TestMacroEngine(t *testing.T) {
})
Convey("interpolate __unixEpochGroup function", func() {
sql, err := engine.Interpolate(query, timeRange, "SELECT $__unixEpochGroup(time_column,'5m')")
So(err, ShouldBeNil)
sql2, err := engine.Interpolate(query, timeRange, "SELECT $__unixEpochGroupAlias(time_column,'5m')")
@@ -118,7 +115,6 @@ func TestMacroEngine(t *testing.T) {
So(sql, ShouldEqual, "SELECT time_column DIV 300 * 300")
So(sql2, ShouldEqual, sql+" AS \"time\"")
})
})
Convey("Given a time range between 1960-02-01 07:00 and 1965-02-03 08:00", func() {
-3
View File
@@ -303,7 +303,6 @@ func TestMySQL(t *testing.T) {
// check for NULL values inserted by fill
So(points[6][0].Valid, ShouldBeFalse)
})
Convey("When doing a metric query using timeGroup and $__interval", func() {
@@ -393,7 +392,6 @@ func TestMySQL(t *testing.T) {
So(points[3][0].Float64, ShouldEqual, 15.0)
So(points[6][0].Float64, ShouldEqual, 20.0)
})
})
Convey("Given a table with metrics having multiple values and measurements", func() {
@@ -779,7 +777,6 @@ func TestMySQL(t *testing.T) {
queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil)
So(queryResult.Meta.Get(sqleng.MetaKeyExecutedQueryString).MustString(), ShouldEqual, "SELECT time FROM metric_values WHERE time > FROM_UNIXTIME(1521118500) OR time < FROM_UNIXTIME(1521118800) OR 1 < 1521118500 OR 1521118800 > 1 ORDER BY 1")
})
Convey("Given a table with event data", func() {
-4
View File
@@ -106,7 +106,6 @@ func (e *OpenTsdbExecutor) createRequest(dsInfo *models.DataSource, data OpenTsd
}
func (e *OpenTsdbExecutor) parseResponse(query OpenTsdbQuery, res *http.Response) (map[string]*tsdb.QueryResult, error) {
queryResults := make(map[string]*tsdb.QueryResult)
queryRes := tsdb.NewQueryResult()
@@ -150,7 +149,6 @@ func (e *OpenTsdbExecutor) parseResponse(query OpenTsdbQuery, res *http.Response
}
func (e *OpenTsdbExecutor) buildMetric(query *tsdb.Query) map[string]interface{} {
metric := make(map[string]interface{})
// Setting metric and aggregator
@@ -174,7 +172,6 @@ func (e *OpenTsdbExecutor) buildMetric(query *tsdb.Query) map[string]interface{}
// Setting rate options
if query.Model.Get("shouldComputeRate").MustBool() {
metric["rate"] = true
rateOptions := make(map[string]interface{})
rateOptions["counter"] = query.Model.Get("isCounter").MustBool()
@@ -209,5 +206,4 @@ func (e *OpenTsdbExecutor) buildMetric(query *tsdb.Query) map[string]interface{}
}
return metric
}
-10
View File
@@ -10,11 +10,9 @@ import (
func TestOpenTsdbExecutor(t *testing.T) {
Convey("OpenTsdb query testing", t, func() {
exec := &OpenTsdbExecutor{}
Convey("Build metric with downsampling enabled", func() {
query := &tsdb.Query{
Model: simplejson.New(),
}
@@ -32,11 +30,9 @@ func TestOpenTsdbExecutor(t *testing.T) {
So(metric["metric"], ShouldEqual, "cpu.average.percent")
So(metric["aggregator"], ShouldEqual, "avg")
So(metric["downsample"], ShouldEqual, "1m-avg")
})
Convey("Build metric with downsampling disabled", func() {
query := &tsdb.Query{
Model: simplejson.New(),
}
@@ -53,11 +49,9 @@ func TestOpenTsdbExecutor(t *testing.T) {
So(len(metric), ShouldEqual, 2)
So(metric["metric"], ShouldEqual, "cpu.average.percent")
So(metric["aggregator"], ShouldEqual, "avg")
})
Convey("Build metric with downsampling enabled with params", func() {
query := &tsdb.Query{
Model: simplejson.New(),
}
@@ -78,7 +72,6 @@ func TestOpenTsdbExecutor(t *testing.T) {
})
Convey("Build metric with tags with downsampling disabled", func() {
query := &tsdb.Query{
Model: simplejson.New(),
}
@@ -108,7 +101,6 @@ func TestOpenTsdbExecutor(t *testing.T) {
})
Convey("Build metric with rate enabled but counter disabled", func() {
query := &tsdb.Query{
Model: simplejson.New(),
}
@@ -138,7 +130,6 @@ func TestOpenTsdbExecutor(t *testing.T) {
})
Convey("Build metric with rate and counter enabled", func() {
query := &tsdb.Query{
Model: simplejson.New(),
}
@@ -171,6 +162,5 @@ func TestOpenTsdbExecutor(t *testing.T) {
So(metric["rateOptions"].(map[string]interface{})["counterMax"], ShouldEqual, 45)
So(metric["rateOptions"].(map[string]interface{})["resetValue"], ShouldEqual, 60)
})
})
}
-1
View File
@@ -35,7 +35,6 @@ func (m *postgresMacroEngine) Interpolate(query *tsdb.Query, timeRange *tsdb.Tim
var macroError error
sql = m.ReplaceAllStringSubmatchFunc(rExp, sql, func(groups []string) string {
// detect if $__timeGroup is supposed to add AS time for pre 5.3 compatibility
// if there is a ',' directly after the macro call $__timeGroup is probably used
// in the old way. Inside window function ORDER BY $__timeGroup will be followed
-9
View File
@@ -59,7 +59,6 @@ func TestMacroEngine(t *testing.T) {
})
Convey("interpolate __timeGroup function pre 5.3 compatibility", func() {
sql, err := engine.Interpolate(query, timeRange, "SELECT $__timeGroup(time_column,'5m'), value")
So(err, ShouldBeNil)
@@ -72,7 +71,6 @@ func TestMacroEngine(t *testing.T) {
})
Convey("interpolate __timeGroup function", func() {
sql, err := engine.Interpolate(query, timeRange, "SELECT $__timeGroup(time_column,'5m')")
So(err, ShouldBeNil)
sql2, err := engine.Interpolate(query, timeRange, "SELECT $__timeGroupAlias(time_column,'5m')")
@@ -83,7 +81,6 @@ func TestMacroEngine(t *testing.T) {
})
Convey("interpolate __timeGroup function with spaces between args", func() {
sql, err := engine.Interpolate(query, timeRange, "$__timeGroup(time_column , '5m')")
So(err, ShouldBeNil)
sql2, err := engine.Interpolate(query, timeRange, "$__timeGroupAlias(time_column , '5m')")
@@ -94,7 +91,6 @@ func TestMacroEngine(t *testing.T) {
})
Convey("interpolate __timeGroup function with TimescaleDB enabled", func() {
sql, err := engineTS.Interpolate(query, timeRange, "GROUP BY $__timeGroup(time_column,'5m')")
So(err, ShouldBeNil)
@@ -102,7 +98,6 @@ func TestMacroEngine(t *testing.T) {
})
Convey("interpolate __timeGroup function with spaces between args and TimescaleDB enabled", func() {
sql, err := engineTS.Interpolate(query, timeRange, "GROUP BY $__timeGroup(time_column , '5m')")
So(err, ShouldBeNil)
@@ -136,7 +131,6 @@ func TestMacroEngine(t *testing.T) {
})
Convey("interpolate __unixEpochGroup function", func() {
sql, err := engine.Interpolate(query, timeRange, "SELECT $__unixEpochGroup(time_column,'5m')")
So(err, ShouldBeNil)
sql2, err := engine.Interpolate(query, timeRange, "SELECT $__unixEpochGroupAlias(time_column,'5m')")
@@ -145,7 +139,6 @@ func TestMacroEngine(t *testing.T) {
So(sql, ShouldEqual, "SELECT floor(time_column/300)*300")
So(sql2, ShouldEqual, sql+" AS \"time\"")
})
})
Convey("Given a time range between 1960-02-01 07:00 and 1965-02-03 08:00", func() {
@@ -213,8 +206,6 @@ func TestMacroEngine(t *testing.T) {
So(sql, ShouldEqual, fmt.Sprintf("WHERE time_column BETWEEN '%s' AND '%s'", from.Format(time.RFC3339Nano), to.Format(time.RFC3339Nano)))
})
})
})
}
-2
View File
@@ -316,7 +316,6 @@ func TestPostgres(t *testing.T) {
// check for NULL values inserted by fill
So(points[6][0].Valid, ShouldBeFalse)
})
Convey("When doing a metric query using timeGroup with value fill enabled", func() {
@@ -709,7 +708,6 @@ func TestPostgres(t *testing.T) {
queryResult := resp.Results["A"]
So(queryResult.Error, ShouldBeNil)
So(queryResult.Meta.Get(sqleng.MetaKeyExecutedQueryString).MustString(), ShouldEqual, "SELECT time FROM metric_values WHERE time > '2018-03-15T12:55:00Z' OR time < '2018-03-15T12:55:00Z' OR 1 < 1521118500 OR 1521118800 > 1 ORDER BY 1")
})
})
-1
View File
@@ -155,6 +155,5 @@ func TestPrometheus(t *testing.T) {
})
})
})
})
}
-1
View File
@@ -58,7 +58,6 @@ func TestSqlEngine(t *testing.T) {
So(sql, ShouldEqual, fmt.Sprintf("select %d", to.Unix()))
})
})
Convey("Given row values with time.Time as time columns", func() {
-1
View File
@@ -11,7 +11,6 @@ import (
func TestTimeRange(t *testing.T) {
Convey("Time range", t, func() {
now := time.Now()
Convey("Can parse 5m, now", func() {