[v9.0.x] Chore: Update grafana-plugin-sdk-go to v0.136.0 (#50127) (#50168)

(cherry picked from commit 64d93498de)
This commit is contained in:
Todd Treece
2022-06-03 07:47:28 -07:00
committed by GitHub
parent 7320c53ab7
commit 301fdc64bf
244 changed files with 48143 additions and 9670 deletions
+3 -16
View File
@@ -37,10 +37,10 @@ func TestMatrixResponses(t *testing.T) {
enableWideSeries := false
queryFileName := filepath.Join("../testdata", test.filepath+".query.json")
responseFileName := filepath.Join("../testdata", test.filepath+".result.json")
goldenFileName := filepath.Join("../testdata", test.filepath+".result.streaming.golden")
goldenFileName := test.filepath + ".result.streaming.golden"
t.Run(test.name, goldenScenario(test.name, queryFileName, responseFileName, goldenFileName, enableWideSeries))
enableWideSeries = true
goldenFileName = filepath.Join("../testdata", test.filepath+".result.streaming-wide.golden")
goldenFileName = test.filepath + ".result.streaming-wide.golden"
t.Run(test.name, goldenScenario(test.name, queryFileName, responseFileName, goldenFileName, enableWideSeries))
}
}
@@ -60,20 +60,7 @@ func goldenScenario(name, queryFileName, responseFileName, goldenFileName string
dr, found := result.Responses["A"]
require.True(t, found)
actual, err := json.MarshalIndent(&dr, "", " ")
require.NoError(t, err)
// nolint:gosec
// We can ignore the gosec G304 because this is a test with static defined paths
expected, err := ioutil.ReadFile(goldenFileName + ".json")
if err != nil || update {
err = os.WriteFile(goldenFileName+".json", actual, 0600)
require.NoError(t, err)
}
require.JSONEq(t, string(expected), string(actual))
require.NoError(t, experimental.CheckGoldenDataResponse(goldenFileName+".txt", &dr, update))
experimental.CheckGoldenJSONResponse(t, "../testdata", goldenFileName, &dr, update)
}
}