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
+11 -6
View File
@@ -420,12 +420,17 @@ func (ss *sqlStore) Count(ctx context.Context) (int64, error) {
func (ss *sqlStore) CountUserAccountsWithEmptyRole(ctx context.Context) (int64, error) {
sb := &db.SQLBuilder{}
sb.Write("SELECT ")
sb.Write(`(SELECT COUNT (*) from ` + ss.dialect.Quote("org_user") + ` AS ou ` +
`LEFT JOIN ` + ss.dialect.Quote("user") + ` AS u ON u.id = ou.user_id ` +
`WHERE ou.role =? ` +
`AND u.is_service_account = ` + ss.dialect.BooleanStr(false) + ` ` +
`AND u.is_disabled = ` + ss.dialect.BooleanStr(false) + `) AS user_accounts_with_no_role`)
sb.Write(`
SELECT sub.user_accounts_with_no_role
FROM (
SELECT COUNT(*) AS user_accounts_with_no_role
FROM ` + ss.dialect.Quote("org_user") + ` AS ou
LEFT JOIN ` + ss.dialect.Quote("user") + ` AS u ON u.id = ou.user_id
WHERE ou.role = ?
AND u.is_service_account = ` + ss.dialect.BooleanStr(false) + `
AND u.is_disabled = ` + ss.dialect.BooleanStr(false) + `
) AS sub
`)
sb.AddParams("None")
var countStats int64
+1 -1
View File
@@ -1021,7 +1021,7 @@ func createFiveTestUsers(t *testing.T, svc user.Service, fn func(i int) *user.Cr
return users
}
func TestMetricsUsage(t *testing.T) {
func TestIntegrationMetricsUsage(t *testing.T) {
ss, cfg := db.InitTestDBWithCfg(t)
userStore := ProvideStore(ss, setting.NewCfg())
quotaService := quotaimpl.ProvideService(ss, cfg)