-
-
Notifications
You must be signed in to change notification settings - Fork 644
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
Ginkgo fails for code which has flag parsing #285
Comments
:( Sadly Ginkgo registers its flags in an I don't know what Go best practices are but I'm forming the opinion that the right approach is always to Sometimes you've just got to adapt the code to make it work with Ginkgo. This is one of those, sorry :/ So... you'll have to change your code:
|
@tinygrasshopper thanks for the effort in isolating a reproduction. A quick google suggests a slight tendency to parse in What would you gain from parsing in |
Thanks for the comments folks. We inherited a codebase which has this issue. The actual code we are trying to modify doesn't look that easy to change, as the flags are populated all over the place. We are going to keep it as it is for now, and use |
@tinygrasshopper I was able to work around this issue. Perhaps this code snippet might help.
|
thanks @dcwangmit01 |
Ginkgo throws an exception when testing the main package if a main package has a init function which parses flags. Works with
go test
, following error is see when executing ginkgo:Testfile:
main.go
We have attached the entire code example as an attachment, unzip it in
$GOPATH/github.com/test/test
to use@henryaj and @tinygrasshopper
one.zip
The text was updated successfully, but these errors were encountered: