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

failed to compile testmain package when running example #344

Closed
MrRickSan opened this issue Oct 2, 2020 · 7 comments · Fixed by #352
Closed

failed to compile testmain package when running example #344

MrRickSan opened this issue Oct 2, 2020 · 7 comments · Fixed by #352
Assignees
Milestone

Comments

@MrRickSan
Copy link

Please answer these questions before submitting a bug report.

What version of godog are you using?

> godog -version
Godog version is: v0.10.0

What version of Go are you using?

> go version
go version go1.15.2 darwin/amd64

What did you do?

I was trying to run the example in github.com/cucumber/godog/_examples/godogs like this:

> godog

What did you expect to see?

The test results, the tests ran successfully.

What did you see instead?

The following output error:

failed to compile testmain package: exit status 2 - output: /var/folders/7p/457816xx2fz6gywn78r25g_m0000gn/T/go-build708885531/b001/_testmain.go:5:2: can't find import: "github.com/cucumber/godog/_examples/godogs"

Additional context

When I run using go test it works:

> go test

Feature: eat godogs
  In order to be happy
  As a hungry gopher
  I need to be able to eat godogs

  Scenario: Eat 5 out of 12          # features/godogs.feature:7
    Given there are 12 godogs        # godogs_test.go:37 -> godogs.thereAreGodogs
    When I eat 5                     # godogs_test.go:41 -> godogs.iEat
    Then there should be 7 remaining # godogs_test.go:49 -> godogs.thereShouldBeRemaining

1 scenarios (1 passed)
3 steps (3 passed)
313.75µs
testing: warning: no tests to run
PASS
ok  	godogs	0.234s
@MrRickSan MrRickSan added the 🐛 bug Defect / Bug label Oct 2, 2020
@MrRickSan
Copy link
Author

Just got it working when using:
❯ GO111MODULE=off godog

@lonnblad
Copy link
Member

lonnblad commented Oct 4, 2020

Hey @MrRickSan, thanks for reporting!

Are you running the godogs example from within the $GOPATH?
I'm thinking that maybe we should look at the documentation around this.

BR Fredrik

@MrRickSan
Copy link
Author

Yes, it was withing the $GOPATH

@lonnblad
Copy link
Member

lonnblad commented Oct 5, 2020

Thanks, makes sense, I will reopen the issue and make sure we add this to the documentation.

@lonnblad lonnblad reopened this Oct 5, 2020
@lonnblad lonnblad added this to the v0.11.0 milestone Oct 5, 2020
@lonnblad lonnblad added improvement and removed 🐛 bug Defect / Bug labels Oct 9, 2020
@lonnblad lonnblad self-assigned this Oct 13, 2020
@lonnblad
Copy link
Member

@MrRickSan, if you want to have a look: #352 :)

@MrRickSan
Copy link
Author

Thank you @lonnblad, welcome improvement!

@abigiyas-code
Copy link

Guys when I run godog after install the godog packages, I get response of
Command 'godog' not found, did you mean:

command 'godoc' from deb golang-golang-x-tools

Try: sudo apt install

I am using Ubuntu 18.04

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

Successfully merging a pull request may close this issue.

3 participants