Skip to content

Commit 832d91a

Browse files
committed
use codersdk experiment value instead of hard-coded string
1 parent a9f2581 commit 832d91a

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

coderd/coderdtest/authorize_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ import (
1111

1212
"github.com/coder/coder/coderd/coderdtest"
1313
"github.com/coder/coder/coderd/rbac"
14+
"github.com/coder/coder/codersdk"
1415
)
1516

1617
func TestAuthorizeAllEndpoints(t *testing.T) {
17-
if strings.Contains(os.Getenv("CODER_EXPERIMENTS_TEST"), "authz_querier") {
18+
if strings.Contains(os.Getenv("CODER_EXPERIMENTS_TEST"), string(codersdk.ExperimentAuthzQuerier)) {
1819
t.Skip("Skipping TestAuthorizeAllEndpoints for authz_querier experiment")
1920
}
2021
t.Parallel()

coderd/coderdtest/coderdtest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func NewOptions(t *testing.T, options *Options) (func(http.Handler), context.Can
181181
options.Database, options.Pubsub = dbtestutil.NewDB(t)
182182
}
183183
// TODO: remove this once we're ready to enable authz querier by default.
184-
if strings.Contains(os.Getenv("CODER_EXPERIMENTS_TEST"), "authz_querier") {
184+
if strings.Contains(os.Getenv("CODER_EXPERIMENTS_TEST"), string(codersdk.ExperimentAuthzQuerier)) {
185185
if options.Authorizer == nil {
186186
options.Authorizer = &RecordingAuthorizer{
187187
Wrapped: rbac.NewAuthorizer(prometheus.NewRegistry()),

enterprise/coderd/coderdenttest/coderdenttest_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func TestNew(t *testing.T) {
2424
}
2525

2626
func TestAuthorizeAllEndpoints(t *testing.T) {
27-
if strings.Contains(os.Getenv("CODER_EXPERIMENTS_TEST"), "authz_querier") {
27+
if strings.Contains(os.Getenv("CODER_EXPERIMENTS_TEST"), string(codersdk.ExperimentAuthzQuerier)) {
2828
t.Skip("Skipping TestAuthorizeAllEndpoints for authz_querier experiment")
2929
}
3030
t.Parallel()

0 commit comments

Comments
 (0)