Replace check for integration tests. (#110707)
* Replace check for integration tests. * Revert changes in pkg/tsdb/mysql packages. * Fix formatting of few tests.
This commit is contained in:
@@ -25,6 +25,7 @@ import (
|
||||
"github.com/grafana/grafana/pkg/services/user"
|
||||
"github.com/grafana/grafana/pkg/services/user/userimpl"
|
||||
"github.com/grafana/grafana/pkg/tests/testsuite"
|
||||
"github.com/grafana/grafana/pkg/util/testutil"
|
||||
)
|
||||
|
||||
// run tests with cleanup
|
||||
@@ -45,9 +46,8 @@ type getUserPermissionsTestCase struct {
|
||||
}
|
||||
|
||||
func TestIntegrationAccessControlStore_GetUserPermissions(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test in short mode")
|
||||
}
|
||||
testutil.SkipIntegrationTestInShortMode(t)
|
||||
|
||||
tests := []getUserPermissionsTestCase{
|
||||
{
|
||||
desc: "should successfully get user, team and builtin permissions",
|
||||
@@ -162,9 +162,8 @@ type getTeamsPermissionsTestCase struct {
|
||||
}
|
||||
|
||||
func TestIntegrationAccessControlStore_GetTeamsPermissions(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test in short mode")
|
||||
}
|
||||
testutil.SkipIntegrationTestInShortMode(t)
|
||||
|
||||
tests := []getTeamsPermissionsTestCase{
|
||||
{
|
||||
desc: "should successfully get team permissions",
|
||||
@@ -237,9 +236,8 @@ func TestIntegrationAccessControlStore_GetTeamsPermissions(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestIntegrationAccessControlStore_DeleteUserPermissions(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test in short mode")
|
||||
}
|
||||
testutil.SkipIntegrationTestInShortMode(t)
|
||||
|
||||
t.Run("expect permissions in all orgs to be deleted", func(t *testing.T) {
|
||||
store, permissionsStore, usrSvc, teamSvc, _, sql := setupTestEnv(t)
|
||||
user, _ := createUserAndTeam(t, sql, usrSvc, teamSvc, 1)
|
||||
@@ -322,9 +320,8 @@ func TestIntegrationAccessControlStore_DeleteUserPermissions(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestIntegrationAccessControlStore_DeleteTeamPermissions(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test in short mode")
|
||||
}
|
||||
testutil.SkipIntegrationTestInShortMode(t)
|
||||
|
||||
t.Run("expect permissions related to team to be deleted", func(t *testing.T) {
|
||||
store, permissionsStore, usrSvc, teamSvc, _, sql := setupTestEnv(t)
|
||||
user, team := createUserAndTeam(t, sql, usrSvc, teamSvc, 1)
|
||||
@@ -505,9 +502,8 @@ func setupTestEnv(t testing.TB) (*database.AccessControlStore, rs.Store, user.Se
|
||||
}
|
||||
|
||||
func TestIntegrationAccessControlStore_SearchUsersPermissions(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test in short mode")
|
||||
}
|
||||
testutil.SkipIntegrationTestInShortMode(t)
|
||||
|
||||
ctx := context.Background()
|
||||
readTeamPerm := func(teamID string) rs.SetResourcePermissionCommand {
|
||||
return rs.SetResourcePermissionCommand{
|
||||
@@ -783,9 +779,8 @@ func TestIntegrationAccessControlStore_SearchUsersPermissions(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestIntegrationAccessControlStore_GetUsersBasicRoles(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test in short mode")
|
||||
}
|
||||
testutil.SkipIntegrationTestInShortMode(t)
|
||||
|
||||
ctx := context.Background()
|
||||
tests := []struct {
|
||||
name string
|
||||
|
||||
Reference in New Issue
Block a user