Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
merged 8 commits into from
Jun 27, 2022

Conversation

kylecarbs
Copy link
Member

No description provided.

@kylecarbs kylecarbs self-assigned this Jun 17, 2022
@kylecarbs kylecarbs force-pushed the fastpg branch 3 times, most recently from be5d517 to 19d8c7e Compare June 17, 2022 14:59
@kylecarbs kylecarbs marked this pull request as ready for review June 21, 2022 16:26
@kylecarbs kylecarbs requested a review from spikecurtis June 21, 2022 16:26
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
Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Contributor

@spikecurtis spikecurtis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kylecarbs kylecarbs enabled auto-merge (squash) June 27, 2022 16:34
@kylecarbs kylecarbs merged commit 6429dfe into main Jun 27, 2022
@kylecarbs kylecarbs deleted the fastpg branch June 27, 2022 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants