Skip to content

Commit 43e1694

Browse files
committed
cleaned up tests
1 parent bc6a271 commit 43e1694

File tree

3 files changed

+2
-42
lines changed

3 files changed

+2
-42
lines changed

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"afero",
44
"apps",
55
"ASKPASS",
6+
"autostop",
67
"awsidentity",
78
"bodyclose",
89
"buildinfo",

codersdk/audit.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import (
1414
type ResourceType string
1515

1616
const (
17-
ResourceTypeOrganization ResourceType = "organization"
1817
ResourceTypeTemplate ResourceType = "template"
1918
ResourceTypeTemplateVersion ResourceType = "template_version"
2019
ResourceTypeUser ResourceType = "user"
@@ -27,8 +26,6 @@ const (
2726

2827
func (r ResourceType) FriendlyString() string {
2928
switch r {
30-
case ResourceTypeOrganization:
31-
return "organization"
3229
case ResourceTypeTemplate:
3330
return "template"
3431
case ResourceTypeTemplateVersion:
@@ -122,7 +119,7 @@ type AuditLogResponse struct {
122119

123120
type CreateTestAuditLogRequest struct {
124121
Action AuditAction `json:"action,omitempty" enums:"create,write,delete,start,stop"`
125-
ResourceType ResourceType `json:"resource_type,omitempty" enums:"organization,template,template_version,user,workspace,workspace_build,git_ssh_key,api_key,group"`
122+
ResourceType ResourceType `json:"resource_type,omitempty" enums:"template,template_version,user,workspace,workspace_build,git_ssh_key,auditable_group"`
126123
ResourceID uuid.UUID `json:"resource_id,omitempty" format:"uuid"`
127124
Time time.Time `json:"time,omitempty" format:"date-time"`
128125
BuildReason BuildReason `json:"build_reason,omitempty" enums:"autostart,autostop,initiator"`

enterprise/audit/diff_internal_test.go

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -275,44 +275,6 @@ func Test_diff(t *testing.T) {
275275
},
276276
})
277277

278-
runDiffTests(t, []diffTest{
279-
{
280-
name: "Create",
281-
left: audit.Empty[database.OrganizationMember](),
282-
right: database.OrganizationMember{
283-
UserID: uuid.UUID{1},
284-
OrganizationID: uuid.UUID{2},
285-
CreatedAt: time.Now(),
286-
UpdatedAt: time.Now(),
287-
Roles: []string{"auditor"},
288-
},
289-
exp: audit.Map{
290-
"user_id": audit.OldNew{Old: "", New: uuid.UUID{1}.String()},
291-
"organization_id": audit.OldNew{Old: "", New: uuid.UUID{2}.String()},
292-
"roles": audit.OldNew{Old: ([]string)(nil), New: []string{"auditor"}},
293-
},
294-
},
295-
})
296-
297-
runDiffTests(t, []diffTest{
298-
{
299-
name: "Create",
300-
left: audit.Empty[database.Organization](),
301-
right: database.Organization{
302-
ID: uuid.UUID{1},
303-
Name: "rust developers",
304-
Description: "an organization for rust developers",
305-
CreatedAt: time.Now(),
306-
UpdatedAt: time.Now(),
307-
},
308-
exp: audit.Map{
309-
"id": audit.OldNew{Old: "", New: uuid.UUID{1}.String()},
310-
"name": audit.OldNew{Old: "", New: "rust developers"},
311-
"description": audit.OldNew{Old: "", New: "an organization for rust developers"},
312-
},
313-
},
314-
})
315-
316278
runDiffTests(t, []diffTest{
317279
{
318280
name: "Create",

0 commit comments

Comments
 (0)