-
-
Notifications
You must be signed in to change notification settings - Fork 122
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
Imports of vendored packages add the vendor prefix to the import path #18
Comments
I'm also seeing a lot of weird errors when trying to use moq with a vendor folder:
These files used to work just fine with Moq until recently. |
Almost certainly introduced by 1bd8336 |
This one is surprisingly difficult to test |
@johanbrandhorst Could you quickly grab branch |
For some reason, the vendoring stuff just isn't working here. |
OK it's working (turns out |
@johanbrandhorst I think I fixed it... can you test it on your code once I merge #19 in? |
p.s. @johanbrandhorst you should do a fresh install... I've also changed the way it captures the calls etc. and it's a breaking change. |
It has not fixed the 2nd problem, I'm still seeing things like
preventing me from testing this quickly without having to comment out all instances moq finds offensive. |
Does not seem to have fixed the other vendoring error either, sorry. |
This is still happening... |
I wonder if you can submit a PR that proves it with a failing test? I couldn't recreate it very easily. It'll probably be an easy fix once we know the actual problem. |
I'll see if I can make a minimal test case, thanks |
https://github.com/johanbrandhorst/moq-vendor-bug/tree/master. This is exhibiting the incorrect import bug but (not yet?) the actual runtime error. |
I'm unfortunately seeing this issue as well. I'm getting import errors whenever I try to generate an interface.
|
If there is a hack or short-term fix for this, it would be much appreciated. I'm not a fan of any of the other mocking libraries besides moq. Is there a commit that we know the vendor/ directory was working for? |
I wonder if someone could make a PR simulating this as a failing test? I cannot reproduce it. It's probably an easy fix, but not if I can't see the error. Perhaps @jayd3e? |
I'll try to create an isolated test to show this behavior. Will get back to you in the next couple days. |
@matryer I just created a repo around this issue, showing what I'm running into. Hope this helps: https://github.com/jayd3e/moq-issue There are notes in the README. |
I made a repo which reproduces the error cause in August. I think Mat wants a test case for the tests, not a repo. |
@johanbrandhorst just to confirm, are you seeing the same issues as I did in that repo? In other words, does my issue appear to be the same one that prompted you creating this thread? |
I can try and create a test, but it would basically just be the same thing as that repo except programatic. |
I've described the two different errors I've seen, the repo I submitted shows the first error (the vendor path pretended to the imported package). I think a programmatic test that reproduces the error is exactly what we want, ideally both of them. |
I'm not able to write a test for this. It might be an environment issue for me. If you guys are able to use |
I have had a suspicion that it might be an environment issue as well... I don't know if it depends on your $GOPATH or the contents of |
Alright, I'll try to do some more debugging on this tonight using my environment. |
I’d love to get this fixed, but it is pretty tough without a a falling test and I cannot reproduce it.
… On 9 Oct 2017, at 23:29, Joseph Dallago ***@***.***> wrote:
Alright, I'll try to do some more debugging on this tonight using my environment.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#18 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAGNG3uLqtULOb_jYvHkZq84CaaX1FKyks5sqp5fgaJpZM4OT_nY>.
|
@matryer are you able to use moq on a project with >10 dependencies using master? If so, I would love to hear how you usually setup your environment. In other words, what you set your GOPATH to and where you put your dependencies(vendor or in the standard GOPATH). |
Hi, I work with @johanbrandhorst and after changing a few too many import paths I found a way to reproduce this issue. My test is in this commit: johnchildren@aa63789 . Obviously it's not a great test but it seems to provide a starting point at least. The problem seems to be with |
I just had the same issue. Is there any movement on this? This is practically a deal breaker. |
I just brought this test into the project and guess what? The test didn't fail. The package it's importing is vendorerd (see it here). It produced this:
|
Thanks for the quick response. I double checked, and it seems it works, but not all of the time. After deleting my go/pkg folder, I got this error:
The issue seems to be related to |
Strange, it's passing for me as well now. I have no idea what has changed, but even backdating my Go to 1.8 and using earlier versions of However the good news is that |
This is back to being broken after #87
|
Any idea why that would break after #87?
… On 13 Feb 2019, at 00:40, Noah Kantrowitz ***@***.***> wrote:
This is back to being broken after #87
$ moq -pkg edit_test ../../../vendor/github.com/aws/aws-sdk-go/service/kms/kmsiface KMSAPI | head
// Code generated by moq; DO NOT EDIT.
// github.com/matryer/moq
package edit_test
import (
"context"
"github.com/Ridecell/ridectl/vendor/github.com/aws/aws-sdk-go/service/kms/kmsiface"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/service/kms"
"sync"
)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
It affected me as well when testing the branch. #87 (comment) |
I recently updated moq (imports, yay!) and tried regenerating one of my files and got the following imports generated:
This obviously doesn't work.
The text was updated successfully, but these errors were encountered: