testcontainers / testcontainers-go

Testcontainers for Go is a Go package that makes it simple to create and clean up container-based dependencies for automated integration/smoke tests. The clean, easy-to-use API enables developers to programmatically define containers that should be run as part of a test and clean up those resources when the test is done.
https://golang.testcontainers.org
MIT License
3.64k stars 500 forks source link

"go get" failure parsing go.mod file #47

Closed vangent closed 5 years ago

vangent commented 5 years ago

I have an implicit dependency on this project and when I run go get -u, I get this error:

go: github.com/testcontainers/testcontainer-go@v0.0.0-20190108154635-47c0da630f72: parsing go.mod: unexpected module path "github.com/testcontainers/testcontainers-go"
MeneDev commented 5 years ago

I have an implicit dependency on this project and when I run go get -u, I get this error: ...

@vangent it was renamed from testcontainer to testcontainers (Plural) for consistency reasons.

What's the other project you depend on? I think the right solution would be changing the dependency there. As a quick fix you should be able to override the path in the config of your dependency manager (e.g. Gopkg).

Sent with GitHawk

vangent commented 5 years ago

I don't know which of my dependencies depend on you. I couldn't tell because "go mod why" failed with the same error. Regardless, I don't own any of them so I couldn't have updated it anyway.

I'm using Go Modules, not a specific dependency manager.

This may just be a side effect of your making a non-backward compatible change, and Go Modules not handling it well.

VoyTechnology commented 5 years ago

As a temporary workaround you can do this:

in go.mod file:

replace github.com/testcontainers/testcontainer-go => github.com/testcontainers/testcontainers-go v0.0.0-20190108154635-47c0da630f72

It looks like go modules only like tag names with v prefix, so the current 0.0.1 tag does not work. The authors need to re-tag it with v0.0.1.

Thanks to @F21: https://github.com/golang/go/issues/26904#issuecomment-455077691

gianarb commented 5 years ago

Thanks @VoyTechnology I was just looking for that trick! @vangent sorry about this bad bc break, but changing the name to keep it consistent was kind of a requirement. I hope you will find the library good and you will give it a try! If the fix works and you are able to understand what project injects our library let me know we will submit a pr to fix it

vangent commented 5 years ago

Thanks for the tips. It sounds like the only action item for the library author is to retag the release with v0.0.1 instead of 0.0.1, to work well with Go Modules.

VoyTechnology commented 5 years ago

I think it would be part of the solution, but also finding any libraries which depend on the old version before rename and filing PRs to update them.

vangent commented 5 years ago

It looks like my problem came from hashicorp -> influxdb: https://github.com/influxdata/influxdb/issues/11199

prologic commented 5 years ago

I'm running into this as well from micro/go-plugins#290 :

go: github.com/testcontainers/testcontainer-go@v0.0.0-20190207081624-4ed65004fe50: parsing go.mod: unexpected module path "github.com/testcontainers/testcontainers-go"
gianarb commented 5 years ago

Hello! Yes! I will work on that asap! Thanks

On Wed, Feb 27, 2019 at 6:55 AM Guan Gui notifications@github.com wrote:

can you fix this? so annoying

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/testcontainers/testcontainers-go/issues/47#issuecomment-467734385, or mute the thread https://github.com/notifications/unsubscribe-auth/ABjgO2rYCnXfWLqn0ILTWOY3edK4aCBkks5vRh3MgaJpZM4aNqL2 .

-- Gianluca Arbezzano www.gianarb.it

guiguan commented 5 years ago

@gianarb it looks like a dependency is expecting github.com/testcontainers/testcontainer-go instead of github.com/testcontainers/testcontainers-go when building gocloud.dev. Probably because you renamed the repo. Strange enough, I couldn't use go mod why to figure which sub-module is expecting that. The replace workaround works. Thanks!

prologic commented 5 years ago

What's the hold-up of getting this fixed for this repo? Can we just re-tag this repo appropriately and move on?

guiguan commented 5 years ago

@prologic I think the real problem is not about the tag, but other packages are still using this repo’s old name, the one without s

prologic commented 5 years ago

Oh I see let me. Erich yny did micro/go-plugins

On Tue, 5 Mar 2019 at 13:11, Guan Gui notifications@github.com wrote:

@prologic https://github.com/prologic I think the real problem is not about the tag, but other packages are still using this repo’s old name, the one without s

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/testcontainers/testcontainers-go/issues/47#issuecomment-469519066, or mute the thread https://github.com/notifications/unsubscribe-auth/ABOv-pkEkO1QZWOC_VLy4mnCYHor7Niwks5vTeBTgaJpZM4aNqL2 .

--

James Mills / prologic

E: prologic@shortcircuit.net.au W: prologic.shortcircuit.net.au

gianarb commented 5 years ago

There is not a lot that I can do about this issue btw. Or is somebody has idea just let me know atm I tagged 0.0.2 and we need to figure out who is using the old name

VoyTechnology commented 5 years ago

Please please please re-tag with v prefix. v0.0.2

gianarb commented 5 years ago

Done

On Thu, Mar 7, 2019 at 11:20 PM Wojtek Bednarzak notifications@github.com wrote:

Please please please re-tag with v prefix. v0.0.2

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/testcontainers/testcontainers-go/issues/47#issuecomment-470698740, or mute the thread https://github.com/notifications/unsubscribe-auth/ABjgO5uCfQTM9PQg6_xyTUIIDX5KsPtZks5vUYKDgaJpZM4aNqL2 .

-- Gianluca Arbezzano www.gianarb.it

gianarb commented 5 years ago

I think we are good for now, And I am gonna keep tagging with the v in front. Sorry about this mess. Closing for now