Chore: use uppercase names in manual entry scenario (#32334)

This commit is contained in:
Ryan McKinley 2021-03-25 16:18:17 -07:00 committed by GitHub
parent 07f7c60ae0
commit adda7c798a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -267,8 +267,8 @@ func (p *testDataPlugin) handleDatapointsOutsideRangeScenario(ctx context.Contex
frame := newSeriesForQuery(q, model, 0)
outsideTime := q.TimeRange.From.Add(-1 * time.Hour)
frame.Fields = data.Fields{
data.NewField("time", nil, []time.Time{outsideTime}),
data.NewField("value", nil, []float64{10}),
data.NewField(data.TimeSeriesTimeFieldName, nil, []time.Time{outsideTime}),
data.NewField(data.TimeSeriesValueFieldName, nil, []float64{10}),
}
respD := resp.Responses[q.RefID]
@ -293,8 +293,8 @@ func (p *testDataPlugin) handleManualEntryScenario(ctx context.Context, req *bac
timeField := data.NewFieldFromFieldType(data.FieldTypeTime, 0)
valueField := data.NewFieldFromFieldType(data.FieldTypeNullableFloat64, 0)
timeField.Name = "time"
valueField.Name = "value"
timeField.Name = data.TimeSeriesTimeFieldName
valueField.Name = data.TimeSeriesValueFieldName
for _, val := range points {
pointValues := val.([]interface{})
@ -795,8 +795,8 @@ func predictableSeries(timeRange backend.TimeRange, timeStep, length int64, getV
}
return data.Fields{
data.NewField("time", nil, timeVec),
data.NewField("value", nil, floatVec),
data.NewField(data.TimeSeriesTimeFieldName, nil, timeVec),
data.NewField(data.TimeSeriesValueFieldName, nil, floatVec),
}, nil
}

View File

@ -224,8 +224,8 @@ func TestTestdataScenarios(t *testing.T) {
require.Len(t, dResp.Frames, 1)
frame := dResp.Frames[0]
require.Len(t, frame.Fields, 2)
require.Equal(t, "time", frame.Fields[0].Name)
require.Equal(t, "value", frame.Fields[1].Name)
require.Equal(t, "Time", frame.Fields[0].Name)
require.Equal(t, "Value", frame.Fields[1].Name)
require.Equal(t, 3, frame.Rows())
vals := frame.Fields[1]