So(rawQuery,ShouldEqual,`SELECT mean("value") FROM "cpu" WHERE $timeFilter GROUP BY time($interval) fill(null)`)
})
})
Convey("empty queries should return error",func(){
Convey("can asd query",func(){
query:=&Query{}
query:=&Query{
Selects:[]*Select{{*qp1,*qp2}},
res,err:=builder.Build(query)
Measurement:"cpu",
So(err,ShouldNotBeNil)
GroupBy:[]*QueryPart{groupBy1},
So(res,ShouldEqual,"")
Tags:[]*Tag{tag1,tag2},
}
rawQuery,err:=builder.Build(query)
So(err,ShouldBeNil)
So(rawQuery,ShouldEqual,`SELECT mean("value") FROM "cpu" WHERE "hostname" = 'server1' OR "hostname" = 'server2' AND $timeFilter GROUP BY time($interval)`)
})
})
})
})
}
}
/*
describe('render series with mesurement only', function() {
it('should generate correct query', function() {
var query = new InfluxQuery({
measurement: 'cpu',
}, templateSrv, {});
var queryText = query.render();
expect(queryText).to.be('SELECT mean("value") FROM "cpu" WHERE $timeFilter GROUP BY time($interval) fill(null)');
});
});
*/
/*
describe('series with tags OR condition', function() {