Skip to content

chore: improve notification template tests' resilience #14196

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 2 commits into from
Aug 7, 2024

Conversation

dannykopping
Copy link
Contributor

I added a nasty little func called enumerateAllTemplates which enumerates all the notification templates defined in coderd/notifications/events.go. Using this, we can determine when we're missing test cases in TestNotificationTemplatesCanRender. I found two, and added those.

This is obviously suboptimal as a strategy: we should be using code-generation and linting. I've covered this in coder/internal#36. In the interim, let's not let the perfect get in the way of better test coverage.

Additionally, this adds the template update message to the TemplateWorkspaceAutoUpdated template so users will be informed of what changed when their template was auto-updated.

Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
@dannykopping dannykopping merged commit c6076d2 into main Aug 7, 2024
28 checks passed
@dannykopping dannykopping deleted the dk/template-version-param branch August 7, 2024 09:33
@github-actions github-actions bot locked and limited conversation to collaborators Aug 7, 2024
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.

3 participants