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
@@ -44,4 +44,9 @@ func addLoginAttemptMigrations(mg *Migrator) {
mg.AddMigration("increase login_attempt.ip_address column length for IPv6 support", NewRawSQLMigration("").
Postgres("ALTER TABLE login_attempt ALTER COLUMN ip_address TYPE VARCHAR(50);").
Mysql("ALTER TABLE login_attempt MODIFY ip_address VARCHAR(50);"))
// Use bigint for "created" column to store timestamps (INT is too small)
mg.AddMigration("alter table login_attempt alter column created type to bigint", NewRawSQLMigration("").
Mysql("ALTER TABLE login_attempt MODIFY created BIGINT;").
Postgres("ALTER TABLE login_attempt ALTER COLUMN created TYPE BIGINT;"))
}
@@ -300,6 +300,10 @@ func addAlertRuleMigrations(mg *migrator.Migrator, defaultIntervalSeconds int64)
mg.AddMigration("fix is_paused column for alert_rule table", migrator.NewRawSQLMigration("").
Postgres(`ALTER TABLE alert_rule ALTER COLUMN is_paused SET DEFAULT false;
UPDATE alert_rule SET is_paused = false;`))
mg.AddMigration("alter table alert_rule alter column rule_group_idx type to bigint", migrator.NewRawSQLMigration("").
Mysql("ALTER TABLE alert_rule MODIFY rule_group_idx BIGINT;").
Postgres("ALTER TABLE alert_rule ALTER COLUMN rule_group_idx TYPE BIGINT;"))
}
var alertRuleVersionUDX_OrgIdRuleUIDVersion = &migrator.Index{Cols: []string{"rule_org_id", "rule_uid", "version"}, Type: migrator.UniqueIndex}
@@ -371,6 +375,10 @@ func addAlertRuleVersionMigrations(mg *migrator.Migrator) {
mg.AddMigration("fix is_paused column for alert_rule_version table", migrator.NewRawSQLMigration("").
Postgres(`ALTER TABLE alert_rule_version ALTER COLUMN is_paused SET DEFAULT false;
UPDATE alert_rule_version SET is_paused = false;`))
mg.AddMigration("alter table alert_rule_version alter column rule_group_idx type to bigint", migrator.NewRawSQLMigration("").
Mysql("ALTER TABLE alert_rule_version MODIFY rule_group_idx BIGINT;").
Postgres("ALTER TABLE alert_rule_version ALTER COLUMN rule_group_idx TYPE BIGINT;"))
}
func addAlertmanagerConfigMigrations(mg *migrator.Migrator) {
@@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/assert"
)
func TestFolderUIDFilter(t *testing.T) {
func TestIntegrationFolderUIDFilter(t *testing.T) {
testCases := []struct {
description string
uids []string
@@ -31,7 +31,7 @@ func TestMain(m *testing.M) {
testsuite.Run(m)
}
func TestBuilder_EqualResults_Basic(t *testing.T) {
func TestIntegrationBuilder_EqualResults_Basic(t *testing.T) {
user := &user.SignedInUser{
UserID: 1,
OrgID: 1,
@@ -75,7 +75,7 @@ func TestBuilder_EqualResults_Basic(t *testing.T) {
}, res)
}
func TestBuilder_Pagination(t *testing.T) {
func TestIntegrationBuilder_Pagination(t *testing.T) {
user := &user.SignedInUser{
UserID: 1,
OrgID: 1,
@@ -122,7 +122,7 @@ func TestBuilder_Pagination(t *testing.T) {
assert.Equal(t, "P", resPg2[0].Title, "page 2 should start with the 16th dashboard")
}
func TestBuilder_RBAC(t *testing.T) {
func TestIntegrationBuilder_RBAC(t *testing.T) {
testsCases := []struct {
desc string
userPermissions []accesscontrol.Permission