Chore: Fix goimports grouping in pkg/services (#62420)

* fix goimports

* fix goimports order
pull/62114/head
Serge Zaitsev 3 years ago committed by GitHub
parent 324310abbc
commit bc2813ef06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      pkg/services/annotations/annotationsimpl/xorm_store_test.go
  2. 3
      pkg/services/cleanup/cleanup_test.go
  3. 4
      pkg/services/comments/sql_storage_test.go
  4. 2
      pkg/services/contexthandler/contexthandler_test.go
  5. 3
      pkg/services/contexthandler/model/model.go
  6. 3
      pkg/services/contexthandler/model/model_test.go
  7. 1
      pkg/services/correlations/api.go
  8. 1
      pkg/services/correlations/correlations.go
  9. 3
      pkg/services/dashboardimport/api/api_test.go
  10. 3
      pkg/services/dashboardimport/service/service_test.go
  11. 3
      pkg/services/dashboardimport/utils/dash_template_evaluator_test.go
  12. 3
      pkg/services/dashboards/dashboard_service_mock.go
  13. 3
      pkg/services/dashboards/folder_store_mock.go
  14. 5
      pkg/services/dashboards/models_test.go
  15. 3
      pkg/services/dashboards/store_mock.go
  16. 1
      pkg/services/encryption/provider/cipher_aescfb_test.go
  17. 3
      pkg/services/encryption/provider/decipher_aes_test.go
  18. 3
      pkg/services/encryption/service/helpers.go
  19. 5
      pkg/services/encryption/service/service_test.go
  20. 7
      pkg/services/folder/folderimpl/folder.go
  21. 1
      pkg/services/folder/folderimpl/sqlstore.go
  22. 4
      pkg/services/grpcserver/health.go
  23. 8
      pkg/services/grpcserver/interceptors/auth.go
  24. 5
      pkg/services/grpcserver/interceptors/auth_test.go
  25. 3
      pkg/services/grpcserver/interceptors/tracing.go
  26. 4
      pkg/services/grpcserver/reflection.go
  27. 10
      pkg/services/grpcserver/service.go
  28. 3
      pkg/services/navtree/navtreeimpl/applinks_test.go
  29. 4
      pkg/services/notifications/codes_test.go
  30. 4
      pkg/services/notifications/send_email_integration_test.go
  31. 3
      pkg/services/notifications/smtp.go
  32. 3
      pkg/services/notifications/smtp_test.go
  33. 3
      pkg/services/org/orgimpl/org_test.go
  34. 3
      pkg/services/plugindashboards/service/service_test.go
  35. 3
      pkg/services/provisioning/alerting/config_reader.go
  36. 3
      pkg/services/provisioning/alerting/config_reader_test.go
  37. 3
      pkg/services/provisioning/alerting/contact_point_types_test.go
  38. 4
      pkg/services/provisioning/alerting/file/rules_types.go
  39. 3
      pkg/services/provisioning/alerting/notification_policy_types_test.go
  40. 3
      pkg/services/provisioning/dashboards/config_reader.go
  41. 3
      pkg/services/provisioning/dashboards/file_reader_symlink_test.go
  42. 3
      pkg/services/provisioning/plugins/config_reader_test.go
  43. 3
      pkg/services/provisioning/provisioning_test.go
  44. 3
      pkg/services/provisioning/values/values_test.go
  45. 1
      pkg/services/query/models.go
  46. 3
      pkg/services/queryhistory/queryhistory_create_test.go
  47. 3
      pkg/services/queryhistory/queryhistory_delete_stale_test.go
  48. 3
      pkg/services/queryhistory/queryhistory_migrate_test.go
  49. 3
      pkg/services/queryhistory/queryhistory_patch_test.go
  50. 3
      pkg/services/queryhistory/queryhistory_star_test.go
  51. 3
      pkg/services/queryhistory/queryhistory_unstar_test.go
  52. 3
      pkg/services/quota/quotaimpl/quota.go
  53. 1
      pkg/services/rendering/mock.go
  54. 5
      pkg/services/rendering/rendering_test.go
  55. 3
      pkg/services/search/service.go
  56. 3
      pkg/services/secrets/kvstore/plugin_test.go
  57. 5
      pkg/services/secrets/manager/helpers.go
  58. 6
      pkg/services/secrets/manager/manager.go
  59. 3
      pkg/services/secrets/manager/metrics.go
  60. 4
      pkg/services/sqlstore/logger.go
  61. 4
      pkg/services/sqlstore/migrations/accesscontrol/action_migrator.go
  62. 7
      pkg/services/sqlstore/migrations/accesscontrol/managed_permission_migrator.go
  63. 5
      pkg/services/sqlstore/migrations/accesscontrol/test/ac_test.go
  64. 4
      pkg/services/sqlstore/migrations/accesscontrol/test/action_migrator_test.go
  65. 5
      pkg/services/sqlstore/migrations/accesscontrol/test/managed_permission_migrator_test.go
  66. 3
      pkg/services/sqlstore/migrations/annotation_mig.go
  67. 3
      pkg/services/sqlstore/migrations/external_alertmanagers.go
  68. 3
      pkg/services/sqlstore/migrations/temp_user.go
  69. 3
      pkg/services/sqlstore/migrations/user_mig.go
  70. 1
      pkg/services/sqlstore/migrator/postgres_dialect.go
  71. 3
      pkg/services/sqlstore/session.go
  72. 3
      pkg/services/sqlstore/sqlstore_test.go
  73. 4
      pkg/services/tag/tagimpl/store_test.go
  74. 6
      pkg/services/user/userimpl/user_test.go

@ -7,7 +7,6 @@ import (
"testing"
"time"
"github.com/grafana/grafana/pkg/services/sqlstore"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@ -20,6 +19,7 @@ import (
dashboardstore "github.com/grafana/grafana/pkg/services/dashboards/database"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/services/quota/quotatest"
"github.com/grafana/grafana/pkg/services/sqlstore"
"github.com/grafana/grafana/pkg/services/tag/tagimpl"
"github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana/pkg/setting"

@ -4,8 +4,9 @@ import (
"testing"
"time"
"github.com/grafana/grafana/pkg/setting"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/setting"
)
func TestCleanUpTmpFiles(t *testing.T) {

@ -5,10 +5,10 @@ import (
"strconv"
"testing"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/infra/db"
"github.com/grafana/grafana/pkg/services/comments/commentmodel"
"github.com/stretchr/testify/require"
)
func createSqlStorage(t *testing.T) Storage {

@ -7,10 +7,10 @@ import (
"net/http/httptest"
"testing"
"github.com/grafana/grafana-plugin-sdk-go/backend/gtime"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana-plugin-sdk-go/backend/gtime"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/services/auth"
"github.com/grafana/grafana/pkg/services/auth/authtest"

@ -5,6 +5,8 @@ import (
"net/http"
"strings"
"github.com/prometheus/client_golang/prometheus"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/infra/tracing"
"github.com/grafana/grafana/pkg/models/usertoken"
@ -13,7 +15,6 @@ import (
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/util/errutil"
"github.com/grafana/grafana/pkg/web"
"github.com/prometheus/client_golang/prometheus"
)
type ReqContext struct {

@ -4,8 +4,9 @@ import (
"net/http"
"testing"
"github.com/grafana/grafana/pkg/web"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/web"
)
func TestQueryBoolWithDefault(t *testing.T) {

@ -10,7 +10,6 @@ import (
ac "github.com/grafana/grafana/pkg/services/accesscontrol"
contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model"
"github.com/grafana/grafana/pkg/services/datasources"
"github.com/grafana/grafana/pkg/web"
)

@ -6,7 +6,6 @@ import (
"github.com/grafana/grafana/pkg/api/routing"
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/events"
"github.com/grafana/grafana/pkg/infra/db"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/services/accesscontrol"

@ -7,6 +7,8 @@ import (
"net/http"
"testing"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/api/routing"
"github.com/grafana/grafana/pkg/components/simplejson"
acmock "github.com/grafana/grafana/pkg/services/accesscontrol/mock"
@ -15,7 +17,6 @@ import (
"github.com/grafana/grafana/pkg/services/quota"
"github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana/pkg/web/webtest"
"github.com/stretchr/testify/require"
)
func TestImportDashboardAPI(t *testing.T) {

@ -6,6 +6,8 @@ import (
"path/filepath"
"testing"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/services/dashboardimport"
"github.com/grafana/grafana/pkg/services/dashboards"
@ -15,7 +17,6 @@ import (
"github.com/grafana/grafana/pkg/services/org"
"github.com/grafana/grafana/pkg/services/plugindashboards"
"github.com/grafana/grafana/pkg/services/user"
"github.com/stretchr/testify/require"
)
func TestImportDashboardService(t *testing.T) {

@ -3,9 +3,10 @@ package utils
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/services/dashboardimport"
"github.com/stretchr/testify/require"
)
func TestDashTemplateEvaluator(t *testing.T) {

@ -5,8 +5,9 @@ package dashboards
import (
context "context"
folder "github.com/grafana/grafana/pkg/services/folder"
mock "github.com/stretchr/testify/mock"
folder "github.com/grafana/grafana/pkg/services/folder"
)
// FakeDashboardService is an autogenerated mock type for the DashboardService type

@ -5,8 +5,9 @@ package dashboards
import (
context "context"
folder "github.com/grafana/grafana/pkg/services/folder"
mock "github.com/stretchr/testify/mock"
folder "github.com/grafana/grafana/pkg/services/folder"
)
// FakeFolderStore is an autogenerated mock type for the FolderStore type

@ -3,11 +3,12 @@ package dashboards
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/infra/slugify"
"github.com/grafana/grafana/pkg/setting"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestGetDashboardUrl(t *testing.T) {

@ -5,11 +5,10 @@ package dashboards
import (
context "context"
folder "github.com/grafana/grafana/pkg/services/folder"
mock "github.com/stretchr/testify/mock"
models "github.com/grafana/grafana/pkg/services/alerting/models"
folder "github.com/grafana/grafana/pkg/services/folder"
quota "github.com/grafana/grafana/pkg/services/quota"
)

@ -5,7 +5,6 @@ import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

@ -4,9 +4,10 @@ import (
"context"
"testing"
"github.com/grafana/grafana/pkg/services/encryption"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/services/encryption"
)
func Test_aesDecipher(t *testing.T) {

@ -3,10 +3,11 @@ package service
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/infra/usagestats"
encryptionprovider "github.com/grafana/grafana/pkg/services/encryption/provider"
"github.com/grafana/grafana/pkg/setting"
"github.com/stretchr/testify/require"
)
func SetupTestService(tb testing.TB) *Service {

@ -4,12 +4,13 @@ import (
"context"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/infra/usagestats"
"github.com/grafana/grafana/pkg/services/encryption"
"github.com/grafana/grafana/pkg/services/encryption/provider"
"github.com/grafana/grafana/pkg/setting"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func Test_Service(t *testing.T) {

@ -15,14 +15,13 @@ import (
"github.com/grafana/grafana/pkg/services/dashboards"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/services/folder"
"github.com/grafana/grafana/pkg/services/sqlstore"
"github.com/grafana/grafana/pkg/services/sqlstore/migrator"
"github.com/grafana/grafana/pkg/util"
"github.com/grafana/grafana/pkg/services/guardian"
"github.com/grafana/grafana/pkg/services/org"
"github.com/grafana/grafana/pkg/services/sqlstore"
"github.com/grafana/grafana/pkg/services/sqlstore/migrator"
"github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/util"
)
type Service struct {

@ -8,6 +8,7 @@ import (
"github.com/VividCortex/mysqlerr"
"github.com/go-sql-driver/mysql"
"github.com/grafana/grafana/pkg/infra/db"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/infra/slugify"

@ -3,10 +3,10 @@ package grpcserver
import (
"context"
"github.com/grafana/grafana/pkg/setting"
"google.golang.org/grpc/health"
"google.golang.org/grpc/health/grpc_health_v1"
"github.com/grafana/grafana/pkg/setting"
)
// HealthService implements GRPC Health Checking Protocol:

@ -4,6 +4,10 @@ import (
"context"
"strings"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
apikeygenprefix "github.com/grafana/grafana/pkg/components/apikeygenprefixed"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/services/accesscontrol"
@ -11,10 +15,6 @@ import (
grpccontext "github.com/grafana/grafana/pkg/services/grpcserver/context"
"github.com/grafana/grafana/pkg/services/org"
"github.com/grafana/grafana/pkg/services/user"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
)
type Authenticator interface {

@ -4,6 +4,9 @@ import (
"context"
"testing"
"github.com/stretchr/testify/require"
"google.golang.org/grpc/metadata"
apikeygenprefix "github.com/grafana/grafana/pkg/components/apikeygenprefixed"
"github.com/grafana/grafana/pkg/infra/tracing"
"github.com/grafana/grafana/pkg/services/accesscontrol"
@ -12,8 +15,6 @@ import (
grpccontext "github.com/grafana/grafana/pkg/services/grpcserver/context"
"github.com/grafana/grafana/pkg/services/org"
"github.com/grafana/grafana/pkg/services/user"
"github.com/stretchr/testify/require"
"google.golang.org/grpc/metadata"
)
func TestAuthenticator_Authenticate(t *testing.T) {

@ -3,8 +3,9 @@ package interceptors
import (
"context"
"github.com/grafana/grafana/pkg/infra/tracing"
"google.golang.org/grpc"
"github.com/grafana/grafana/pkg/infra/tracing"
)
const tracingPrefix = "gRPC Server "

@ -3,10 +3,10 @@ package grpcserver
import (
"context"
"github.com/grafana/grafana/pkg/setting"
"google.golang.org/grpc/reflection"
"google.golang.org/grpc/reflection/grpc_reflection_v1alpha"
"github.com/grafana/grafana/pkg/setting"
)
// ReflectionService implements the gRPC Server Reflection Protocol:

@ -6,17 +6,17 @@ import (
"net"
"github.com/grafana/grafana-plugin-sdk-go/backend"
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
grpcAuth "github.com/grpc-ecosystem/go-grpc-middleware/auth"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/infra/tracing"
"github.com/grafana/grafana/pkg/registry"
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/services/grpcserver/interceptors"
"github.com/grafana/grafana/pkg/setting"
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
grpcAuth "github.com/grpc-ecosystem/go-grpc-middleware/auth"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
)
type Provider interface {

@ -4,6 +4,8 @@ import (
"net/http"
"testing"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/models/roletype"
"github.com/grafana/grafana/pkg/plugins"
@ -18,7 +20,6 @@ import (
"github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/web"
"github.com/stretchr/testify/require"
)
func TestAddAppLinks(t *testing.T) {

@ -6,10 +6,10 @@ import (
"testing"
"time"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana/pkg/setting"
"github.com/stretchr/testify/require"
)
func TestTimeLimitCodes(t *testing.T) {

@ -5,9 +5,9 @@ import (
"os"
"testing"
"github.com/grafana/grafana/pkg/setting"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/setting"
)
func TestEmailIntegrationTest(t *testing.T) {

@ -8,8 +8,9 @@ import (
"strconv"
"strings"
"github.com/grafana/grafana/pkg/setting"
gomail "gopkg.in/mail.v2"
"github.com/grafana/grafana/pkg/setting"
)
type SmtpClient struct {

@ -5,9 +5,10 @@ import (
"strings"
"testing"
"github.com/grafana/grafana/pkg/setting"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/setting"
)
func TestBuildMail(t *testing.T) {

@ -4,10 +4,11 @@ import (
"context"
"testing"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/services/org"
"github.com/grafana/grafana/pkg/services/quota"
"github.com/grafana/grafana/pkg/setting"
"github.com/stretchr/testify/require"
)
func TestOrgService(t *testing.T) {

@ -8,12 +8,13 @@ import (
"sort"
"testing"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/plugins"
"github.com/grafana/grafana/pkg/plugins/manager/dashboards"
dashmodels "github.com/grafana/grafana/pkg/services/dashboards"
"github.com/grafana/grafana/pkg/services/plugindashboards"
"github.com/stretchr/testify/require"
)
func TestGetPluginDashboards(t *testing.T) {

@ -8,8 +8,9 @@ import (
"path/filepath"
"strings"
"github.com/grafana/grafana/pkg/infra/log"
"gopkg.in/yaml.v3"
"github.com/grafana/grafana/pkg/infra/log"
)
type rulesConfigReader struct {

@ -4,8 +4,9 @@ import (
"context"
"testing"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/infra/log"
)
const (

@ -3,9 +3,10 @@ package alerting
import (
"testing"
"github.com/grafana/grafana/pkg/services/provisioning/values"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"github.com/grafana/grafana/pkg/services/provisioning/values"
)
func TestReceivers(t *testing.T) {

@ -7,10 +7,10 @@ import (
"strings"
"time"
"github.com/prometheus/common/model"
"github.com/grafana/grafana/pkg/services/ngalert/models"
"github.com/grafana/grafana/pkg/services/provisioning/values"
"github.com/prometheus/common/model"
)
type RuleDelete struct {

@ -4,9 +4,8 @@ import (
"os"
"testing"
"gopkg.in/yaml.v3"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
)
func TestNotificationPolicy(t *testing.T) {

@ -8,10 +8,11 @@ import (
"path/filepath"
"strings"
"gopkg.in/yaml.v3"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/services/org"
"github.com/grafana/grafana/pkg/services/provisioning/utils"
"gopkg.in/yaml.v3"
)
type configReader struct {

@ -7,9 +7,10 @@ import (
"path/filepath"
"testing"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/infra/log"
)
var (

@ -5,9 +5,10 @@ import (
"os"
"testing"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/plugins"
"github.com/stretchr/testify/require"
)
const (

@ -6,12 +6,13 @@ import (
"testing"
"time"
"github.com/stretchr/testify/assert"
dashboardstore "github.com/grafana/grafana/pkg/services/dashboards"
"github.com/grafana/grafana/pkg/services/org"
"github.com/grafana/grafana/pkg/services/provisioning/dashboards"
"github.com/grafana/grafana/pkg/services/provisioning/utils"
"github.com/grafana/grafana/pkg/setting"
"github.com/stretchr/testify/assert"
)
func TestProvisioningServiceImpl(t *testing.T) {

@ -6,11 +6,12 @@ import (
"os"
"testing"
"github.com/grafana/grafana/pkg/setting"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/ini.v1"
"gopkg.in/yaml.v3"
"github.com/grafana/grafana/pkg/setting"
)
func TestValues(t *testing.T) {

@ -5,6 +5,7 @@ import (
"strings"
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/services/contexthandler"
"github.com/grafana/grafana/pkg/services/datasources"

@ -3,8 +3,9 @@ package queryhistory
import (
"testing"
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/components/simplejson"
)
func TestIntegrationCreateQueryInQueryHistory(t *testing.T) {

@ -5,8 +5,9 @@ import (
"testing"
"time"
"github.com/grafana/grafana/pkg/web"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/web"
)
func TestIntegrationDeleteStaleQueryFromQueryHistory(t *testing.T) {

@ -5,8 +5,9 @@ import (
"testing"
"time"
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/components/simplejson"
)
func TestIntegrationMigrateQueriesToQueryHistory(t *testing.T) {

@ -3,8 +3,9 @@ package queryhistory
import (
"testing"
"github.com/grafana/grafana/pkg/web"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/web"
)
func TestIntegrationPatchQueryCommentInQueryHistory(t *testing.T) {

@ -3,8 +3,9 @@ package queryhistory
import (
"testing"
"github.com/grafana/grafana/pkg/web"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/web"
)
func TestIntegrationStarQueryInQueryHistory(t *testing.T) {

@ -3,8 +3,9 @@ package queryhistory
import (
"testing"
"github.com/grafana/grafana/pkg/web"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/web"
)
func TestIntegrationUnstarQueryInQueryHistory(t *testing.T) {

@ -4,12 +4,13 @@ import (
"context"
"sync"
"golang.org/x/sync/errgroup"
"github.com/grafana/grafana/pkg/infra/db"
"github.com/grafana/grafana/pkg/infra/log"
contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model"
"github.com/grafana/grafana/pkg/services/quota"
"github.com/grafana/grafana/pkg/setting"
"golang.org/x/sync/errgroup"
)
type serviceDisabled struct {

@ -9,6 +9,7 @@ import (
reflect "reflect"
gomock "github.com/golang/mock/gomock"
models "github.com/grafana/grafana/pkg/models"
)

@ -9,12 +9,13 @@ import (
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/plugins"
"github.com/grafana/grafana/pkg/setting"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestGetUrl(t *testing.T) {

@ -5,12 +5,11 @@ import (
"sort"
"github.com/grafana/grafana/pkg/infra/db"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/services/dashboards"
"github.com/grafana/grafana/pkg/services/star"
"github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/models"
)
func ProvideService(cfg *setting.Cfg, sqlstore db.DB, starService star.Service, dashboardService dashboards.DashboardService) *SearchService {

@ -4,9 +4,10 @@ import (
"context"
"testing"
"github.com/grafana/grafana/pkg/plugins/backendplugin/secretsmanagerplugin"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/plugins/backendplugin/secretsmanagerplugin"
)
// Set fatal flag to true, then simulate a plugin start failure

@ -3,6 +3,9 @@ package manager
import (
"testing"
"github.com/stretchr/testify/require"
"gopkg.in/ini.v1"
"github.com/grafana/grafana/pkg/infra/usagestats"
encryptionprovider "github.com/grafana/grafana/pkg/services/encryption/provider"
encryptionservice "github.com/grafana/grafana/pkg/services/encryption/service"
@ -10,8 +13,6 @@ import (
"github.com/grafana/grafana/pkg/services/kmsproviders/osskmsproviders"
"github.com/grafana/grafana/pkg/services/secrets"
"github.com/grafana/grafana/pkg/setting"
"github.com/stretchr/testify/require"
"gopkg.in/ini.v1"
)
func SetupTestService(tb testing.TB, store secrets.Store) *SecretsService {

@ -11,6 +11,9 @@ import (
"sync"
"time"
"github.com/prometheus/client_golang/prometheus"
"golang.org/x/sync/errgroup"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/infra/usagestats"
"github.com/grafana/grafana/pkg/services/encryption"
@ -19,9 +22,6 @@ import (
"github.com/grafana/grafana/pkg/services/secrets"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/util"
"github.com/prometheus/client_golang/prometheus"
"golang.org/x/sync/errgroup"
)
const (

@ -1,9 +1,10 @@
package manager
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/grafana/grafana/pkg/infra/metrics"
"github.com/grafana/grafana/pkg/infra/metrics/metricutil"
"github.com/prometheus/client_golang/prometheus"
)
const (

@ -3,9 +3,9 @@ package sqlstore
import (
"fmt"
glog "github.com/grafana/grafana/pkg/infra/log"
"xorm.io/core"
glog "github.com/grafana/grafana/pkg/infra/log"
)
type XormLogger struct {

@ -4,10 +4,10 @@ import (
"fmt"
"strings"
"xorm.io/xorm"
"github.com/grafana/grafana/pkg/services/accesscontrol"
"github.com/grafana/grafana/pkg/services/sqlstore/migrator"
"xorm.io/xorm"
)
const ActionMigrationID = "RBAC action name migrator"

@ -12,13 +12,14 @@ import (
"strings"
"time"
"golang.org/x/text/cases"
"golang.org/x/text/language"
"xorm.io/xorm"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/services/accesscontrol"
"github.com/grafana/grafana/pkg/services/org"
"github.com/grafana/grafana/pkg/services/sqlstore/migrator"
"golang.org/x/text/cases"
"golang.org/x/text/language"
"xorm.io/xorm"
)
const ManagedPermissionsMigrationID = "managed permissions migration"

@ -6,6 +6,8 @@ import (
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"xorm.io/xorm"
"github.com/grafana/grafana/pkg/infra/log"
@ -19,9 +21,6 @@ import (
"github.com/grafana/grafana/pkg/services/team"
"github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana/pkg/setting"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
type rawPermission struct {

@ -4,15 +4,15 @@ import (
"fmt"
"testing"
"github.com/grafana/grafana/pkg/services/dashboards"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/services/accesscontrol"
"github.com/grafana/grafana/pkg/services/dashboards"
acmig "github.com/grafana/grafana/pkg/services/sqlstore/migrations/accesscontrol"
"github.com/grafana/grafana/pkg/services/sqlstore/migrator"
"github.com/grafana/grafana/pkg/setting"
"github.com/stretchr/testify/require"
)
func TestActionMigration(t *testing.T) {

@ -6,13 +6,14 @@ import (
"strings"
"testing"
"github.com/stretchr/testify/require"
"xorm.io/xorm"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/services/accesscontrol"
acmig "github.com/grafana/grafana/pkg/services/sqlstore/migrations/accesscontrol"
"github.com/grafana/grafana/pkg/services/sqlstore/migrator"
"github.com/grafana/grafana/pkg/setting"
"github.com/stretchr/testify/require"
"xorm.io/xorm"
)
type inheritanceTestCase struct {

@ -1,8 +1,9 @@
package migrations
import (
. "github.com/grafana/grafana/pkg/services/sqlstore/migrator"
"xorm.io/xorm"
. "github.com/grafana/grafana/pkg/services/sqlstore/migrator"
)
func addAnnotationMig(mg *Migrator) {

@ -5,12 +5,13 @@ import (
"net/url"
"time"
"xorm.io/xorm"
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/services/datasources"
"github.com/grafana/grafana/pkg/services/sqlstore/migrations/ualert"
"github.com/grafana/grafana/pkg/services/sqlstore/migrator"
"github.com/grafana/grafana/pkg/util"
"xorm.io/xorm"
)
func AddExternalAlertmanagerToDatasourceMigration(mg *migrator.Migrator) {

@ -3,8 +3,9 @@ package migrations
import (
"time"
. "github.com/grafana/grafana/pkg/services/sqlstore/migrator"
"xorm.io/xorm"
. "github.com/grafana/grafana/pkg/services/sqlstore/migrator"
)
func addTempUserMigrations(mg *Migrator) {

@ -3,9 +3,10 @@ package migrations
import (
"fmt"
"xorm.io/xorm"
. "github.com/grafana/grafana/pkg/services/sqlstore/migrator"
"github.com/grafana/grafana/pkg/util"
"xorm.io/xorm"
)
func addUserMigrations(mg *Migrator) {

@ -9,7 +9,6 @@ import (
"github.com/golang-migrate/migrate/v4/database"
"github.com/lib/pq"
"xorm.io/xorm"
)

@ -7,11 +7,10 @@ import (
"reflect"
"time"
"github.com/mattn/go-sqlite3"
"go.opentelemetry.io/otel/attribute"
"xorm.io/xorm"
"github.com/mattn/go-sqlite3"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/infra/tracing"
"github.com/grafana/grafana/pkg/services/sqlstore/migrator"

@ -5,8 +5,9 @@ import (
"net/url"
"testing"
"github.com/grafana/grafana/pkg/setting"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/setting"
)
type sqlStoreTest struct {

@ -4,10 +4,10 @@ import (
"context"
"testing"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/infra/db"
"github.com/grafana/grafana/pkg/services/tag"
"github.com/stretchr/testify/require"
)
type getStore func(db.DB) store

@ -5,6 +5,9 @@ import (
"errors"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/infra/localcache"
"github.com/grafana/grafana/pkg/models/roletype"
"github.com/grafana/grafana/pkg/services/org"
@ -12,9 +15,6 @@ import (
"github.com/grafana/grafana/pkg/services/team/teamtest"
"github.com/grafana/grafana/pkg/services/user"
"github.com/grafana/grafana/pkg/setting"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestUserService(t *testing.T) {

Loading…
Cancel
Save