Additional code cleanup
This commit is contained in:
@@ -7,23 +7,6 @@ import (
|
||||
"github.com/influxdata/telegraf/metric"
|
||||
)
|
||||
|
||||
// func TestDefaultConnectAndWrite(t *testing.T) {
|
||||
// if testing.Short() {
|
||||
// t.Skip("Skipping integration test in short mode")
|
||||
// }
|
||||
|
||||
// // Test with all defaults (MSI+IMS)
|
||||
// azmon := &AzureMonitor{}
|
||||
|
||||
// // Verify that we can connect to Log Analytics
|
||||
// err := azmon.Connect()
|
||||
// require.NoError(t, err)
|
||||
|
||||
// // Verify that we can write a metric to Log Analytics
|
||||
// err = azmon.Write(testutil.MockMetrics())
|
||||
// require.NoError(t, err)
|
||||
// }
|
||||
|
||||
// MockMetrics returns a mock []telegraf.Metric object for using in unit tests
|
||||
// of telegraf output sinks.
|
||||
func getMockMetrics() []telegraf.Metric {
|
||||
@@ -55,35 +38,3 @@ func getTestMetric(value interface{}, name ...string) telegraf.Metric {
|
||||
)
|
||||
return pt
|
||||
}
|
||||
|
||||
// func TestPostData(t *testing.T) {
|
||||
// azmon := &AzureMonitor{
|
||||
// Region: "eastus",
|
||||
// }
|
||||
// err := azmon.Connect()
|
||||
|
||||
// metrics := getMockMetrics()
|
||||
// t.Logf("mock metrics are %+v\n", metrics)
|
||||
// // metricsList, err := azmon.add(&metrics[0])
|
||||
// for _, m := range metrics {
|
||||
// azmon.Add(m)
|
||||
// }
|
||||
|
||||
// jsonBytes, err := json.Marshal(azmon.cache)
|
||||
// t.Logf("json content is:\n----------\n%s\n----------\n", string(jsonBytes))
|
||||
|
||||
// req, err := azmon.postData(&jsonBytes)
|
||||
// if err != nil {
|
||||
// // t.Logf("Error publishing metrics %s", err)
|
||||
// t.Logf("url is %+v\n", req.URL)
|
||||
// // t.Logf("failed request is %+v\n", req)
|
||||
|
||||
// // raw, err := httputil.DumpRequestOut(req, true)
|
||||
// // if err != nil {
|
||||
// // t.Logf("Request detail is \n%s\n", string(raw))
|
||||
// // } else {
|
||||
// // t.Logf("could not dump request: %s\n", err)
|
||||
// // }
|
||||
// }
|
||||
// require.NoError(t, err)
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user