Skip to content
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

utilizing apm agent in a project that utilizes godog directly causes import errors #922

Closed
adam-stokes opened this issue Mar 29, 2021 · 3 comments
Labels

Comments

@adam-stokes
Copy link

Describe the bug
We are utilizing godog and the go apm agent code directly in our project https://github.com/elastic/e2e-testing. When attempting to get our modules in sync we get an import error:

[adam:~/Projects/e2e-testing] master(+23/-1058)* 1 ± go mod tidy
go: finding module for package github.com/cucumber/godog/gherkin
github.com/elasticsearch/e2e-testing/cli/services imports
        go.elastic.co/apm tested by
        go.elastic.co/apm.test imports
        go.elastic.co/apm/internal/apmgodog imports
        github.com/cucumber/godog/gherkin: module github.com/cucumber/godog@latest found (v0.11.0), but does not contain package github.com/cucumber/godog/gherkin

I believe it is due to the fact that the dependencies defined here are pinned to v0.8.1 where the gherkin package was part of the godog module but has since been extracted out (see https://github.com/cucumber/godog/blob/master/release-notes/v0.9.0.md)

Pinning our module dependency to 0.8.1 does get around this issue but we have some requirements related to junit that are avaialable in a newer version of godog.

To Reproduce
Steps to reproduce the behavior:

  1. git clone https://github.com/elastic/e2e-testing
  2. git checkout gh-fix-557
  3. go mod tidy
[adam:~/Projects/e2e-testing] master(+23/-1058)* 1 ± go mod tidy
go: finding module for package github.com/cucumber/godog/gherkin
github.com/elasticsearch/e2e-testing/cli/services imports
        go.elastic.co/apm tested by
        go.elastic.co/apm.test imports
        go.elastic.co/apm/internal/apmgodog imports
        github.com/cucumber/godog/gherkin: module github.com/cucumber/godog@latest found (v0.11.0), but does not contain package github.com/cucumber/godog/gherkin

I did attempt to use the exclude parameter in go.mod but didn't have any success. Was curious if anything could be done or if you know of any potential workarounds to allowing us to use this module and godog directly?

@axw
Copy link
Member

axw commented Mar 29, 2021

In #899 I moved the godog dependency to an internal module, so this shouldn't happen from the next release. In the mean time, you could use the most recent commit in your go.mod.

@adam-stokes
Copy link
Author

Thanks for the help @axw I was able to address this in elastic/e2e-testing@db79d42, will keep an eye out for the next go apm release

@adam-stokes
Copy link
Author

Closing as this will be addressed in the next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants