mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
test: ensure the return value of MockAuditor.Contains is checked (#18319)
It unfortunately doesn't seem possible, even with a custom ruleguard rule, to mark a function as requiring it's return value be used, it looks like you have to go all in on a linter that rejects *any* unused return values.
This commit is contained in:
@ -135,7 +135,7 @@ func TestAuditReport(t *testing.T) {
|
||||
},
|
||||
})
|
||||
|
||||
mAudit.Contains(t, database.AuditLog{
|
||||
require.True(t, mAudit.Contains(t, database.AuditLog{
|
||||
Time: dbtime.Time(tt.time).In(time.UTC),
|
||||
Action: agentProtoConnectionActionToAudit(t, *tt.action),
|
||||
OrganizationID: workspace.OrganizationID,
|
||||
@ -146,7 +146,7 @@ func TestAuditReport(t *testing.T) {
|
||||
ResourceTarget: agent.Name,
|
||||
Ip: pqtype.Inet{Valid: true, IPNet: net.IPNet{IP: net.ParseIP(tt.ip), Mask: net.CIDRMask(32, 32)}},
|
||||
StatusCode: tt.status,
|
||||
})
|
||||
}))
|
||||
|
||||
// Check some additional fields.
|
||||
var m map[string]any
|
||||
|
Reference in New Issue
Block a user