mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
chore(scripts/rules.go): broaden scope of testingWithOwnerUser linter (#10548)
* Updated testingWithOwnerUser ruleguard rule to detect: a) Passing client from coderdenttest.New() to clitest.SetupConfig() similar to what already exists for AGPL code b) Usage of any method of the owner client from coderdenttest.New() - all usages of the owner client must be justified with a `//nolint:gocritic` comment. * Fixed resulting linter complaints. * Added new coderdtest helpers CreateGroup and UpdateTemplateMeta. * Modified check_enterprise_import.sh to ignore scripts/rules.go.
This commit is contained in:
@ -153,6 +153,7 @@ func TestUserQuietHours(t *testing.T) {
|
||||
})
|
||||
|
||||
ctx := testutil.Context(t, testutil.WaitLong)
|
||||
//nolint:gocritic // We want to test the lack of entitlement, not RBAC.
|
||||
_, err := client.UserQuietHoursSchedule(ctx, user.UserID.String())
|
||||
require.Error(t, err)
|
||||
var sdkErr *codersdk.Error
|
||||
@ -181,6 +182,7 @@ func TestUserQuietHours(t *testing.T) {
|
||||
})
|
||||
|
||||
ctx := testutil.Context(t, testutil.WaitLong)
|
||||
//nolint:gocritic // We want to test the lack of feature, not RBAC.
|
||||
_, err := client.UserQuietHoursSchedule(ctx, user.UserID.String())
|
||||
require.Error(t, err)
|
||||
var sdkErr *codersdk.Error
|
||||
@ -208,6 +210,7 @@ func TestUserQuietHours(t *testing.T) {
|
||||
})
|
||||
|
||||
ctx := testutil.Context(t, testutil.WaitLong)
|
||||
//nolint:gocritic // We want to test the lack of feature, not RBAC.
|
||||
_, err := client.UserQuietHoursSchedule(ctx, user.UserID.String())
|
||||
require.Error(t, err)
|
||||
var sdkErr *codersdk.Error
|
||||
|
Reference in New Issue
Block a user