8000 chore: enforcement of dbauthz tests was broken by Emyrk · Pull Request #11218 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

chore: enforcement of dbauthz tests was broken #11218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
< 10000 h5 data-view-component="true" class="mb-2"> Diff view
Prev Previous commit
Next Next commit
lint
  • Loading branch information
Emyrk committed Dec 15, 2023
commit 440573aa887895916f4edc2b8620e9a0480fbbf4
4 changes: 2 additions & 2 deletions coderd/database/dbauthz/dbauthz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2066,7 +2066,7 @@ func (s *MethodTestSuite) TestSystemFunctions() {
check.Args().Asserts(rbac.ResourceSystem, rbac.ActionDelete)
}))
s.Run("InsertWorkspaceAgentStats", s.Subtest(func(db database.Store, check *expects) {
check.Args(database.InsertWorkspaceAgentStatsParams{}).Asserts(rbac.ResourceSystem, rbac.ActionCreate).Errors(matchAnyError)
check.Args(database.InsertWorkspaceAgentStatsParams{}).Asserts(rbac.ResourceSystem, rbac.ActionCreate).Errors(errMatchAny)
}))
s.Run("InsertWorkspaceAppStats", s.Subtest(func(db database.Store, check *expects) {
check.Args(database.InsertWorkspaceAppStatsParams{}).Asserts(rbac.ResourceSystem, rbac.ActionCreate)
Expand Down Expand Up @@ -2131,7 +2131,7 @@ func (s *MethodTestSuite) TestSystemFunctions() {
check.Args().Asserts(rbac.ResourceSystem, rbac.ActionUpdate)
}))
s.Run("InsertMissingGroups", s.Subtest(func(db database.Store, check *expects) {
check.Args(database.InsertMissingGroupsParams{}).Asserts(rbac.ResourceSystem, rbac.ActionCreate).Errors(matchAnyError)
check.Args(database.InsertMissingGroupsParams{}).Asserts(rbac.ResourceSystem, rbac.ActionCreate).Errors(errMatchAny)
}))
s.Run("UpdateUserLoginType", s.Subtest(func(db database.Store, check *expects) {
u := dbgen.User(s.T(), db, database.User{})
Expand Down
4 changes: 2 additions & 2 deletions coderd/database/dbauthz/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"github.com/coder/coder/v2/coderd/util/slice"
)

var matchAnyError = errors.New("match any error")
var errMatchAny = errors.New("match any error")

var skipMethods = map[string]string{
"InTx": "Not relevant",
Expand Down Expand Up @@ -177,7 +177,7 @@ func (s *MethodTestSuite) Subtest(testCaseF func(db database.Store, check *expec
if testCase.err == nil {
s.NoError(err, "method %q returned an error", methodName)
} else {
if errors.Is(testCase.err, matchAnyError) {
if errors.Is(testCase.err, errMatchAny) {
// This means we do not care exactly what the error is.
s.Error(err, "method %q returned an error", methodName)
} else {
Expand Down
0