-
Notifications
You must be signed in to change notification settings - Fork 881
test: Use a template to prevent migrations from running for every test #2462
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
Conversation
be5d517
to
19d8c7e
Compare
Makefile
Outdated
@@ -112,14 +112,6 @@ site/src/api/typesGenerated.ts: scripts/apitypings/main.go $(shell find codersdk | |||
test: test-clean | |||
gotestsum -- -v -short ./... | |||
|
|||
.PHONY: test-postgres |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why drop this make target?
It's important for developers to be able to more-or-less exactly (closer the better) reproduce CI build/test locally so that we can reproduce errors that CI discovers. To that end, you want to keep all the logic in the Makefile or build scripts and then the CI just executes those targets/scripts.
This PR takes us in the opposite direction, removing stuff from make and baking it into the CI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assumes an external PostgreSQL instance is running, which breaks a pretty fundamental rule of make
(which declares explicit chaining dependencies).
I'm fine to move this in a script, but it's not idiomatic to have a make
target with external deps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair. Would be nice to have a .PHONY
target that runs a script to ensure the postgres docker container is up, and list it in the dependencies of this target.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.