-
Notifications
You must be signed in to change notification settings - Fork 607
Conversation
Previous behavior was a panic would happen if the number of args did not match. Now the test should fail more gracefully and allow for better debugging. Fixes: #71
Apologies, my reflection-fu is a little weak. Does this correctly handle variadic functions? I have a bunch of
in 1.6.0. Or perhaps this is a Hyrum’s Law thing? |
@bconway Would you please open an issue with a simple example for discussion. This may be too strict in the case of varargs... need to take a closer look. |
There were a lot of DoAndReturn usages in our tests that didn't correctly use the client func signatures. With golang/mock#558 this is now validated and tests fail, if the signature of the provided func literal is not the same as the one of the real func. This commit fixes our wrong usages to comply with the newest gomock behavior.
* Vendor golang/mock@v1.6.0 * Fix wrong DoAndReturn usages There were a lot of DoAndReturn usages in our tests that didn't correctly use the client func signatures. With golang/mock#558 this is now validated and tests fail, if the signature of the provided func literal is not the same as the one of the real func. This commit fixes our wrong usages to comply with the newest gomock behavior.
I have the same issue, I reverted back to |
@codyoss When you see it that way having variadic arguments does have a meaning, it is not just there because the author was lazy. In one of my tests using it calling a method will trigger two parallel call to an external interface, I have a waitgroup and use |
golang/mock@82ce4a7 (golang/mock#558) introduced a breaking change to how go-mock works, this broke the dry-mode mock. This commit fixes it Also replaces ginkgo with a simple logger for more clear errors when mocks go wrong
* NO-ISSUE: Swarm fix - controller looks at wrong env var to cluster hosts config * NO-ISSUE: Fix go-mock 1.5.0->1.6.0 backwards compat issue golang/mock@82ce4a7 (golang/mock#558) introduced a breaking change to how go-mock works, this broke the dry-mode mock. This commit fixes it Also replaces ginkgo with a simple logger for more clear errors when mocks go wrong
* Vendor golang/mock@v1.6.0 * Fix wrong DoAndReturn usages There were a lot of DoAndReturn usages in our tests that didn't correctly use the client func signatures. With golang/mock#558 this is now validated and tests fail, if the signature of the provided func literal is not the same as the one of the real func. This commit fixes our wrong usages to comply with the newest gomock behavior.
* Vendor golang/mock@v1.6.0 * Fix wrong DoAndReturn usages There were a lot of DoAndReturn usages in our tests that didn't correctly use the client func signatures. With golang/mock#558 this is now validated and tests fail, if the signature of the provided func literal is not the same as the one of the real func. This commit fixes our wrong usages to comply with the newest gomock behavior.
Previous behavior was a panic would happen if the number of args
did not match. Now the test should fail more gracefully and allow
for better debugging.
Fixes: #71