Add test to influxql AST parsing of durations with no WHERE clause

pull/1378/head
Chris Goller 2017-05-02 15:46:16 -05:00
parent 6ee108d5b7
commit 72421f7954
1 changed files with 20 additions and 0 deletions

View File

@ -150,6 +150,26 @@ func TestConvert(t *testing.T) {
},
},
},
{
name: "Test with no where clauses",
influxQL: `SELECT usage_user from telegraf.autogen.cpu`,
want: chronograf.QueryConfig{
Database: "telegraf",
Measurement: "cpu",
RetentionPolicy: "autogen",
Fields: []chronograf.Field{
chronograf.Field{
Field: "usage_user",
Funcs: []string{},
},
},
Tags: map[string][]string{},
GroupBy: chronograf.GroupBy{
Time: "",
Tags: []string{},
},
},
},
{
name: "Test tags accepted",
influxQL: `SELECT usage_user from telegraf.autogen.cpu where "host" = 'myhost' and time > now() - 15m`,