Chore: Rename integration tests to follow the common convention (#105987)

* automatically rename integration tests to follow the common convention

* name tests differently

* alter column type to bigint

* update another column to bigint

* add another alter

* fix subquery for mysql
This commit is contained in:
Serge Zaitsev
2025-06-29 16:56:24 +02:00
committed by GitHub
parent 4374fe9137
commit f66a693438
64 changed files with 186 additions and 168 deletions
@@ -49,7 +49,7 @@ func setupTestEnv(t testing.TB) *Service {
return ac
}
func TestUsageMetrics(t *testing.T) {
func TestIntegrationUsageMetrics(t *testing.T) {
tests := []struct {
name string
expectedValue int
@@ -80,7 +80,7 @@ func TestUsageMetrics(t *testing.T) {
}
}
func TestService_DeclareFixedRoles(t *testing.T) {
func TestIntegrationService_DeclareFixedRoles(t *testing.T) {
tests := []struct {
name string
registrations []accesscontrol.RoleRegistration
@@ -165,7 +165,7 @@ func TestService_DeclareFixedRoles(t *testing.T) {
}
}
func TestService_DeclarePluginRoles(t *testing.T) {
func TestIntegrationService_DeclarePluginRoles(t *testing.T) {
tests := []struct {
name string
pluginID string
@@ -278,7 +278,7 @@ func TestService_DeclarePluginRoles(t *testing.T) {
}
}
func TestService_RegisterFixedRoles(t *testing.T) {
func TestIntegrationService_RegisterFixedRoles(t *testing.T) {
tests := []struct {
name string
token licensing.Licensing
@@ -380,7 +380,7 @@ func TestService_RegisterFixedRoles(t *testing.T) {
}
}
func TestService_SearchUsersPermissions(t *testing.T) {
func TestIntegrationService_SearchUsersPermissions(t *testing.T) {
searchOption := accesscontrol.SearchOptions{ActionPrefix: "teams"}
ctx := context.Background()
listAllPerms := map[string][]string{accesscontrol.ActionUsersPermissionsRead: {"users:*"}}
@@ -601,7 +601,7 @@ func TestService_SearchUsersPermissions(t *testing.T) {
}
}
func TestService_SearchUserPermissions(t *testing.T) {
func TestIntegrationService_SearchUserPermissions(t *testing.T) {
ctx := context.Background()
tests := []struct {
name string
@@ -832,7 +832,7 @@ func TestService_SearchUserPermissions(t *testing.T) {
}
}
func TestService_SaveExternalServiceRole(t *testing.T) {
func TestIntegrationService_SaveExternalServiceRole(t *testing.T) {
type run struct {
cmd accesscontrol.SaveExternalServiceRoleCommand
wantErr bool
@@ -918,7 +918,7 @@ func TestService_SaveExternalServiceRole(t *testing.T) {
}
}
func TestService_DeleteExternalServiceRole(t *testing.T) {
func TestIntegrationService_DeleteExternalServiceRole(t *testing.T) {
tests := []struct {
name string
initCmd *accesscontrol.SaveExternalServiceRoleCommand
@@ -971,7 +971,7 @@ func TestService_DeleteExternalServiceRole(t *testing.T) {
}
}
func TestService_GetRoleByName(t *testing.T) {
func TestIntegrationService_GetRoleByName(t *testing.T) {
t.Parallel()
ctx := context.Background()
@@ -44,7 +44,7 @@ type getUserPermissionsTestCase struct {
policyCount int
}
func TestAccessControlStore_GetUserPermissions(t *testing.T) {
func TestIntegrationAccessControlStore_GetUserPermissions(t *testing.T) {
tests := []getUserPermissionsTestCase{
{
desc: "should successfully get user, team and builtin permissions",
@@ -158,7 +158,7 @@ type getTeamsPermissionsTestCase struct {
expected int
}
func TestAccessControlStore_GetTeamsPermissions(t *testing.T) {
func TestIntegrationAccessControlStore_GetTeamsPermissions(t *testing.T) {
tests := []getTeamsPermissionsTestCase{
{
desc: "should successfully get team permissions",
@@ -230,7 +230,7 @@ func TestAccessControlStore_GetTeamsPermissions(t *testing.T) {
}
}
func TestAccessControlStore_DeleteUserPermissions(t *testing.T) {
func TestIntegrationAccessControlStore_DeleteUserPermissions(t *testing.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)
@@ -312,7 +312,7 @@ func TestAccessControlStore_DeleteUserPermissions(t *testing.T) {
})
}
func TestAccessControlStore_DeleteTeamPermissions(t *testing.T) {
func TestIntegrationAccessControlStore_DeleteTeamPermissions(t *testing.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)
@@ -767,7 +767,7 @@ func TestIntegrationAccessControlStore_SearchUsersPermissions(t *testing.T) {
}
}
func TestAccessControlStore_GetUsersBasicRoles(t *testing.T) {
func TestIntegrationAccessControlStore_GetUsersBasicRoles(t *testing.T) {
ctx := context.Background()
tests := []struct {
name string
@@ -12,7 +12,7 @@ import (
"github.com/stretchr/testify/require"
)
func TestAccessControlStore_SaveExternalServiceRole(t *testing.T) {
func TestIntegrationAccessControlStore_SaveExternalServiceRole(t *testing.T) {
type run struct {
cmd accesscontrol.SaveExternalServiceRoleCommand
wantErr bool
@@ -152,7 +152,7 @@ func TestAccessControlStore_SaveExternalServiceRole(t *testing.T) {
}
}
func TestAccessControlStore_DeleteExternalServiceRole(t *testing.T) {
func TestIntegrationAccessControlStore_DeleteExternalServiceRole(t *testing.T) {
extID := "app1"
tests := []struct {
name string
+1 -1
View File
@@ -32,7 +32,7 @@ func TestMain(m *testing.M) {
testsuite.Run(m)
}
func TestFilter_Datasources(t *testing.T) {
func TestIntegrationFilter_Datasources(t *testing.T) {
tests := []filterDatasourcesTestCase{
{
desc: "expect all data sources to be returned",
@@ -30,7 +30,7 @@ type getDescriptionTestCase struct {
expectedStatus int
}
func TestApi_getDescription(t *testing.T) {
func TestIntegrationApi_getDescription(t *testing.T) {
tests := []getDescriptionTestCase{
{
desc: "should return description",
@@ -135,7 +135,7 @@ type getPermissionsTestCase struct {
expectedStatus int
}
func TestApi_getPermissions(t *testing.T) {
func TestIntegrationApi_getPermissions(t *testing.T) {
tests := []getPermissionsTestCase{
{
desc: "expect permissions for resource with id 1",
@@ -181,7 +181,7 @@ type setBuiltinPermissionTestCase struct {
permissions []accesscontrol.Permission
}
func TestApi_setBuiltinRolePermission(t *testing.T) {
func TestIntegrationApi_setBuiltinRolePermission(t *testing.T) {
tests := []setBuiltinPermissionTestCase{
{
desc: "should set Edit permission for Viewer",
@@ -260,7 +260,7 @@ type setTeamPermissionTestCase struct {
byUID bool
}
func TestApi_setTeamPermission(t *testing.T) {
func TestIntegrationApi_setTeamPermission(t *testing.T) {
tests := []setTeamPermissionTestCase{
{
desc: "should set Edit permission for team 1",
@@ -367,7 +367,7 @@ type setUserPermissionTestCase struct {
permissions []accesscontrol.Permission
}
func TestApi_setUserPermission(t *testing.T) {
func TestIntegrationApi_setUserPermission(t *testing.T) {
tests := []setUserPermissionTestCase{
{
desc: "should set Edit permission for user 1",
@@ -442,7 +442,7 @@ func TestApi_setUserPermission(t *testing.T) {
}
}
func TestApi_setUserPermissionForTeams(t *testing.T) {
func TestIntegrationApi_setUserPermissionForTeams(t *testing.T) {
type setUserPermissionForTeamsTestCase struct {
setUserPermissionTestCase
teamCmd *team.CreateTeamCommand
@@ -31,7 +31,7 @@ type setUserPermissionTest struct {
callHook bool
}
func TestService_SetUserPermission(t *testing.T) {
func TestIntegrationService_SetUserPermission(t *testing.T) {
tests := []setUserPermissionTest{
{
desc: "should call hook when updating user permissions",
@@ -75,7 +75,7 @@ type setTeamPermissionTest struct {
callHook bool
}
func TestService_SetTeamPermission(t *testing.T) {
func TestIntegrationService_SetTeamPermission(t *testing.T) {
tests := []setTeamPermissionTest{
{
desc: "should call hook when updating user permissions",
@@ -124,7 +124,7 @@ type setBuiltInRolePermissionTest struct {
callHook bool
}
func TestService_SetBuiltInRolePermission(t *testing.T) {
func TestIntegrationService_SetBuiltInRolePermission(t *testing.T) {
tests := []setBuiltInRolePermissionTest{
{
desc: "should call hook when updating user permissions",
@@ -166,7 +166,7 @@ type setPermissionsTest struct {
expectErr bool
}
func TestService_SetPermissions(t *testing.T) {
func TestIntegrationService_SetPermissions(t *testing.T) {
tests := []setPermissionsTest{
{
desc: "should set all permissions",
@@ -235,7 +235,7 @@ func TestService_SetPermissions(t *testing.T) {
}
}
func TestService_RegisterActionSets(t *testing.T) {
func TestIntegrationService_RegisterActionSets(t *testing.T) {
type registerActionSetsTest struct {
desc string
options Options