Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Proposal: allow 'buffalo test' to test a single package #907

Closed
arschles opened this issue Feb 8, 2018 · 3 comments
Closed

Proposal: allow 'buffalo test' to test a single package #907

arschles opened this issue Feb 8, 2018 · 3 comments

Comments

@arschles
Copy link
Contributor

arschles commented Feb 8, 2018

It's often useful to run buffalo test against a single sub-package. For example, I may just want to fix a bug in one of my grifts, and in that case, I likely won't be interested in running my actions tests while I'm doing that edit-test work.

Proposal

I am proposing that the buffalo test command treats the first argument differently. Currently, buffalo test ./grifts/... prepends ./grifts/... to the list of packages that it passes to the go test command.

My proposal is to make the first argument to buffalo test be the only package passed to the go test command.

Instead of this behavior:

$ buffalo test ./mypkg
dropped database mydb
created database mydb
loaded schema for mydb
go test -p 1 ./mypkg/... github.com/arschles/something/actions github.com/arschles/something/grifts github.com/arschles/something/mypkg

I'm proposing this behavior:

$ buffalo test ./mypkg
dropped database mydb
created database mydb
loaded schema for mydb
go test -p 1 ./mypkg/...

This change would bring buffalo test a little bit more in line with the behavior of go test.

@paganotoni
Copy link
Member

@arschles I like this proposal and think the proposed behavior makes much more sense than current one, I'm curious to know if there was a reason to do it the way we currently do it or we just didn't consider this behavior.

@arschles are you willing to work on this PR?
@markbates thoughts on this one?

@markbates
Copy link
Member

I think it’s a great idea. As long as the default behavior is still run all packages, then I’m on board and would love to see a PR.

@arschles
Copy link
Contributor Author

arschles commented Feb 9, 2018

Cool - I'll see if I can get this in tomorrow. Otherwise it'll have to be next wk

arschles added a commit to arschles/buffalo that referenced this issue Feb 9, 2018
markbates pushed a commit that referenced this issue Feb 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants