Skip to content

chore: improve testing coverage on ExtractProvisionerDaemonAuthenticated middleware #15622

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 8 commits into from
Nov 26, 2024
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
Prev Previous commit
improve testing coverage
  • Loading branch information
defelmnq committed Nov 25, 2024
commit 711eeeefe7ceaf76c68079b049ecba5a8488acfa
5 changes: 3 additions & 2 deletions enterprise/coderd/httpmw/provisionerdaemon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ func TestExtractProvisionerDaemonAuthenticated(t *testing.T) {
DB: nil,
Optional: true,
},
provisionerKey: "invalid",
provisionerKey: "invalid",
expectedStatusCode: http.StatusOK,
},
{
name: "InvalidProvisionerPSK_NotOptional",
Expand Down Expand Up @@ -283,7 +284,7 @@ func TestExtractProvisionerDaemonAuthenticated(t *testing.T) {
})).ServeHTTP(res, r)

//nolint:bodyclose
require.Equal(t, http.StatusUnauthorized, res.Result().StatusCode)
require.Equal(t, http.StatusInternalServerError, res.Result().StatusCode)
require.Contains(t, res.Body.String(), "get provisioner daemon key")
})
}
Loading