Skip to content

Commit ca00727

Browse files
committed
remove audit log check from test that does not need to'
1 parent 5da4c8b commit ca00727

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

enterprise/coderd/users_test.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ import (
1010
"github.com/stretchr/testify/assert"
1111
"github.com/stretchr/testify/require"
1212

13-
"github.com/coder/coder/v2/coderd/audit"
1413
"github.com/coder/coder/v2/coderd/coderdtest"
15-
"github.com/coder/coder/v2/coderd/database"
1614
"github.com/coder/coder/v2/coderd/rbac"
1715
"github.com/coder/coder/v2/coderd/schedule/cron"
1816
"github.com/coder/coder/v2/codersdk"
@@ -553,14 +551,12 @@ func TestEnterprisePostUser(t *testing.T) {
553551

554552
t.Run("CreateWithoutOrg", func(t *testing.T) {
555553
t.Parallel()
556-
auditor := audit.NewMock()
557554
dv := coderdtest.DeploymentValues(t)
558555
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
559556

560557
client, firstUser := coderdenttest.New(t, &coderdenttest.Options{
561558
Options: &coderdtest.Options{
562559
DeploymentValues: dv,
563-
Auditor: auditor,
564560
},
565561
LicenseOptions: &coderdenttest.LicenseOptions{
566562
Features: license.Features{
@@ -575,8 +571,6 @@ func TestEnterprisePostUser(t *testing.T) {
575571
// Add an extra org to try and confuse user creation
576572
coderdenttest.CreateOrganization(t, client, coderdenttest.CreateOrganizationOptions{})
577573

578-
numLogs := len(auditor.AuditLogs())
579-
580574
// nolint:gocritic // intentional using the owner.
581575
// Manually making a user with the request instead of the coderdtest util
582576
user, err := client.CreateUser(ctx, codersdk.CreateUserRequest{
@@ -585,11 +579,6 @@ func TestEnterprisePostUser(t *testing.T) {
585579
Password: "SomeSecurePassword!",
586580
})
587581
require.NoError(t, err)
588-
numLogs++ // add an audit log for user create
589-
590-
require.Len(t, auditor.AuditLogs(), numLogs)
591-
require.Equal(t, database.AuditActionCreate, auditor.AuditLogs()[numLogs-1].Action)
592-
require.Equal(t, database.AuditActionLogin, auditor.AuditLogs()[numLogs-3].Action)
593582

594583
require.Len(t, user.OrganizationIDs, 1)
595584
assert.Equal(t, firstUser.OrganizationID, user.OrganizationIDs[0])

0 commit comments

Comments
 (0)