Skip to content

test: create unit test to match nil deref behavior #17501

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 4 commits into from
Apr 23, 2025
Merged
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
Diff view
Next Next commit
test: create unit test to match nil deref behavior
  • Loading branch information
Emyrk committed Apr 22, 2025
commit 97a0183d7cf11f9fd4818e3e84f0f8fd77a81f92
14 changes: 14 additions & 0 deletions coderd/provisionerdserver/provisionerdserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"storj.io/drpc"

"cdr.dev/slog/sloggers/slogtest"
"github.com/coder/coder/v2/coderd"
"github.com/coder/coder/v2/coderd/rbac"
"github.com/coder/quartz"
"github.com/coder/serpent"
Expand Down Expand Up @@ -125,6 +126,19 @@ func TestHeartbeat(t *testing.T) {
// goleak.VerifyTestMain ensures that the heartbeat goroutine does not leak
}

func TestOptionsOIDCConfig(t *testing.T) {
t.Parallel()

var cfg *coderd.OIDCConfig
opts := provisionerdserver.Options{
// We pass in the oidc config like so, causing the interface
// to be not nil.
OIDCConfig: cfg,
}

require.True(t, opts.OIDCConfig == nil)
}

func TestAcquireJob(t *testing.T) {
t.Parallel()

Expand Down
Loading