Skip to content

test: Increase test coverage on auditable resources #7038

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 5 commits into from
Apr 6, 2023

Conversation

Emyrk
Copy link
Member

@Emyrk Emyrk commented Apr 6, 2023

When adding a new audit resource, we also need to add it to the
function switch statements. This is a likely mistake, now a unit
test will check this for you

Missing a type

table_internal_test.go:85: ResourceTarget switch statement is missing type "github.com/coder/coder/coderd/database.TemplateVersion". Include it in the switch case block

Extra type

table_internal_test.go:85: ResourceTarget switch statement has unexpected type "github.com/coder/coder/coderd/database.TemplateACL". Remove it from the switch case block

Emyrk added 2 commits April 6, 2023 13:09
When adding a new audit resource, we also need to add it to the
function switch statements. This is a likely mistake, now a unit
test will check this for you
@Emyrk Emyrk merged commit b2892c3 into main Apr 6, 2023
@Emyrk Emyrk deleted the stevenmasley/more_audit_tests branch April 6, 2023 21:16
@github-actions github-actions bot locked and limited conversation to collaborators Apr 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants