Chore: Remove context.TODO() (#43409)

* Remove context.TODO() from services

* Fix live test

* Remove context.TODO
This commit is contained in:
idafurjes
2021-12-22 11:02:42 +01:00
committed by GitHub
parent 2409d8dc1f
commit b8852ef6a3
45 changed files with 133 additions and 126 deletions
@@ -2,6 +2,7 @@ package alerting
import (
"bytes"
"context"
"encoding/json"
"fmt"
"io/ioutil"
@@ -716,7 +717,7 @@ func TestPrometheusRulesPermissions(t *testing.T) {
}
// remove permissions from folder2
require.NoError(t, store.UpdateDashboardACL(2, nil))
require.NoError(t, store.UpdateDashboardACL(context.Background(), 2, nil))
// make sure that folder2 is not included in the response
{
@@ -765,7 +766,7 @@ func TestPrometheusRulesPermissions(t *testing.T) {
}
// remove permissions from _ALL_ folders
require.NoError(t, store.UpdateDashboardACL(1, nil))
require.NoError(t, store.UpdateDashboardACL(context.Background(), 1, nil))
// make sure that no folders are included in the response
{
+3 -2
View File
@@ -2,6 +2,7 @@ package alerting
import (
"bytes"
"context"
"encoding/json"
"fmt"
"io/ioutil"
@@ -174,7 +175,7 @@ func TestAlertRulePermissions(t *testing.T) {
assert.JSONEq(t, expectedGetNamespaceResponseBody, body)
// remove permissions from folder2
require.NoError(t, store.UpdateDashboardACL(2, nil))
require.NoError(t, store.UpdateDashboardACL(context.Background(), 2, nil))
// make sure that folder2 is not included in the response
// nolint:gosec
@@ -247,7 +248,7 @@ func TestAlertRulePermissions(t *testing.T) {
}
// Remove permissions from ALL folders.
require.NoError(t, store.UpdateDashboardACL(1, nil))
require.NoError(t, store.UpdateDashboardACL(context.Background(), 1, nil))
{
u := fmt.Sprintf("http://grafana:password@%s/api/ruler/grafana/api/v1/rules", grafanaListedAddr)
// nolint:gosec