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:
Ethan
2025-06-11 17:16:18 +10:00
committed by GitHub
parent dd27a28cfa
commit 2377d76ebb
2 changed files with 4 additions and 4 deletions

View File

@ -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