Skip to content

Commit

Permalink
refactor(cmd/influxd): use simple query rather than the flux service
Browse files Browse the repository at this point in the history
  • Loading branch information
goller committed Feb 21, 2019
1 parent c742b1f commit 7f72207
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions cmd/influxd/launcher/storage_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package launcher_test

import (
"bytes"
"fmt"
"io/ioutil"
nethttp "net/http"
Expand Down Expand Up @@ -75,15 +74,11 @@ func (l *Launcher) WriteOrFail(tb testing.TB, to *influxdb.OnboardingResults, da
// or fails if there is an error.
func (l *Launcher) FluxQueryOrFail(tb testing.TB, org *influxdb.Organization, token string, query string) string {
tb.Helper()
var buf bytes.Buffer

fs := &http.FluxService{Addr: l.URL(), Token: token}

req := (http.QueryRequest{Query: query, Org: org}).WithDefaults()
if preq, err := req.ProxyRequest(); err != nil {
tb.Fatal(err)
} else if _, err := fs.Query(ctx, &buf, preq); err != nil {
b, err := http.SimpleQuery(l.URL(), query, org.Name, token)
if err != nil {
tb.Fatal(err)
}
return buf.String()

return string(b)
}

0 comments on commit 7f72207

Please sign in to comment.