Discussion point: ability to specify Flags prefix#502
Discussion point: ability to specify Flags prefix#502carldunham wants to merge 1 commit intoonsi:masterfrom
Conversation
|
Thanks for you PR @carldunham, I really appreciate that you took the time to fix the docs for contributions and Coming back to that, what is the actual problem you would like to solve? As far as I understand with this PR the compiled test file will have duplicate options with |
|
@nodo Happy to split the PR. I'll actually submit that separately. As for the extant issue, I ran into this basically because I was refusing to bend to Go's will with respect to project structure, mainly due to existing project constraints (multiple languages, other devs, existing conventions, etc). It also seems to be the same problem raised in #234. I provided a toy project that also illustrates the issue in https://github.com/carldunham/go-dep-test. It should be something that could be fixed in later versions of Go (1.11 module support, perhaps), but still could arise in cases where different versions of Ginkgo were required by different modules, say. The suggestion in the PR is foolish, as you gently didn't say 😸, but I wasn't able to do something cleaner in a short time. A more rational approach might just be to avoid setting the flags on subsequent calls to Thanks! |
48bd5be to
5a73661
Compare
|
Still get the mac:extended-platform-tests jianzhang$ ./extended-platform-tests run all --dry-run
./extended-platform-tests flag redefined: ginkgo.seed
panic: ./extended-platform-tests flag redefined: ginkgo.seed
goroutine 1 [running]:
flag.(*FlagSet).Var(0xc000178540, 0x8757400, 0xd0c57a0, 0xc00364a042, 0xb, 0x7c2bd0e, 0x2a)
/usr/local/Cellar/go/1.13.1/libexec/src/flag/flag.go:848 +0x4ae
flag.(*FlagSet).Int64Var(...)
/usr/local/Cellar/go/1.13.1/libexec/src/flag/flag.go:673
github.com/openshift/origin/vendor/github.com/onsi/ginkgo/config.Flags(0xc000178540, 0x7b541f6, 0x6, 0x5719001)
/Users/jianzhang/goproject/src/github.com/openshift/origin/vendor/github.com/onsi/ginkgo/config/config.go:68 +0x114
github.com/openshift/origin/vendor/github.com/onsi/ginkgo.init.0()
/Users/jianzhang/goproject/src/github.com/openshift/origin/vendor/github.com/onsi/ginkgo/ginkgo_dsl.go:58 +0x10a |
This is a hacky way to do this, but should work. Open to other options.