Skip to content

Commit c285f6f

Browse files
committed
skip GetAuthorizedWorkspaces
1 parent 9dbc6bf commit c285f6f

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

coderd/authzquery/methods_test.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ import (
2121
)
2222

2323
var (
24-
skipMethods = map[string]any{
25-
"InTx": struct{}{},
26-
"Ping": struct{}{},
24+
skipMethods = map[string]string{
25+
"InTx": "Not relevant",
26+
"Ping": "Not relevant",
27+
"GetAuthorizedWorkspaces": "Will not be exposed",
2728
}
2829
)
2930

@@ -56,6 +57,8 @@ func (s *MethodTestSuite) SetupSuite() {
5657
for i := 0; i < azt.NumMethod(); i++ {
5758
method := azt.Method(i)
5859
if _, ok := skipMethods[method.Name]; ok {
60+
// We can't use s.T().Skip as this will skip the entire suite.
61+
s.T().Logf("Skipping method %q: %s", method.Name, skipMethods[method.Name])
5962
continue
6063
}
6164
s.methodAccounting[method.Name] = 0
@@ -212,7 +215,7 @@ func asserts(inputs ...any) []AssertRBAC {
212215
for i := 0; i < len(inputs); i += 2 {
213216
obj, ok := inputs[i].(rbac.Objecter)
214217
if !ok {
215-
panic(fmt.Sprintf("object type '%T' does not implement rbac.Objecter", obj))
218+
panic(fmt.Sprintf("object type '%T' does not implement rbac.Objecter", inputs[i]))
216219
}
217220
rbacObj := obj.RBACObject()
218221

@@ -224,7 +227,7 @@ func asserts(inputs ...any) []AssertRBAC {
224227
// Could be the string type.
225228
actionAsString, ok := inputs[i+1].(string)
226229
if !ok {
227-
panic(fmt.Sprintf("action type '%T' not a supported action", obj))
230+
panic(fmt.Sprintf("action '%q' not a supported action", actionAsString))
228231
}
229232
action = rbac.Action(actionAsString)
230233
}

0 commit comments

Comments
 (0)