Skip to content
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

How to pass arguments to ginkgo if I run go test? #381

Closed
ryan-ju opened this issue Oct 12, 2017 · 8 comments
Closed

How to pass arguments to ginkgo if I run go test? #381

ryan-ju opened this issue Oct 12, 2017 · 8 comments

Comments

@ryan-ju
Copy link

ryan-ju commented Oct 12, 2017

I can't figure out how to pass -v or -trace arguments to ginkgo if I run my test as go test.

Is this supported?

@iandelahorne
Copy link
Collaborator

-ginkgo.v and -ginkgo.trace, respectively.

@williammartin
Copy link
Collaborator

@ryan-ju Looks like this is closeable now. If you have any further questions please feel free to reopen.

Thanks @lflux for the response.

@anandsinghkunwar
Copy link

This doesn't work.

go test ./e2e -ginkgo.v -ginkgo.progress

But this works,

cd e2e
go test -ginkgo.v -ginkgo.progress

@iandelahorne Do you have any idea why this might be?

@williammartin
Copy link
Collaborator

Have you tried:

go test -ginkgo.v -ginkgo.progress ./e2e

@anandsinghkunwar
Copy link

Yes, I get can't load package error

@williammartin
Copy link
Collaborator

Right, I think I was a little confused by your "doesn't work" in your first comment.

→ go test ./scratchpad -ginkgo.v
→ ps aux | grep test
...
pivotal          18443   0.0  0.0  4385664   8916 s010  S+   12:57pm   0:00.01 /var/folders/sr/40vc_pv552v9ggy1_fvb3zdw0000gn/T/go-build224624199/b001/scratchpad.test -ginkgo.v

We can see here that the ginkgo.v argument is passed to the test binary.

I suspect what you are saying is "I don't get verbose output". When you run go test in package list mode i.e. go test <pkg> OR even go test . the test runner turns down the verbosity in comparison to local directory mode i.e. go test.

As such, I suspect the command you are looking to run is:

go test ./e2e -ginkgo.v -ginkgo.progress -test.v

Let me know if this works for you

@anandsinghkunwar
Copy link

@williammartin This works! Thanks a ton, I always thought this was a ginkgo bug but never checked the ps aux output to verify. I just assumed it was related to ordering and flag parsing and a corner case that wasn't handled. Glad to know it was a user error. :)

@williammartin
Copy link
Collaborator

Neat, no worries, it's a bit confusing behaviour that you need to pass two verbose flags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants