From 8011109466af8ddf276fd62567f0299490ef3cf4 Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Thu, 5 Oct 2017 16:37:58 -0700 Subject: [PATCH] Remove InfluxDB path prefix test This tests a feature that is not yet on this branch and the test was mistakenly backported. --- plugins/outputs/influxdb/client/http_test.go | 34 -------------------- 1 file changed, 34 deletions(-) diff --git a/plugins/outputs/influxdb/client/http_test.go b/plugins/outputs/influxdb/client/http_test.go index 2cb0182e8..0bbf947a8 100644 --- a/plugins/outputs/influxdb/client/http_test.go +++ b/plugins/outputs/influxdb/client/http_test.go @@ -299,37 +299,3 @@ func TestGzipCompression(t *testing.T) { assert.Equal(t, []byte(influxLine), uncompressed.Bytes()) } - -func TestHTTPClient_PathPrefix(t *testing.T) { - prefix := "/some/random/prefix" - ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - switch r.URL.Path { - case prefix + "/write": - w.WriteHeader(http.StatusNoContent) - w.Header().Set("Content-Type", "application/json") - case prefix + "/query": - w.WriteHeader(http.StatusOK) - w.Header().Set("Content-Type", "application/json") - fmt.Fprintln(w, `{"results":[{}]}`) - default: - w.WriteHeader(http.StatusNotFound) - msg := fmt.Sprintf("Path not found: %s", r.URL.Path) - fmt.Fprintln(w, msg) - } - })) - defer ts.Close() - - config := HTTPConfig{ - URL: ts.URL + prefix, - } - wp := WriteParams{ - Database: "test", - } - client, err := NewHTTP(config, wp) - defer client.Close() - assert.NoError(t, err) - err = client.Query("CREATE DATABASE test") - assert.NoError(t, err) - err = client.WriteStream(bytes.NewReader([]byte("cpu value=99\n"))) - assert.NoError(t, err) -}