godog failed to compile testmain package - but should improve the error message
- Dominant language
- Go
- Stars
- 2.7k
- Forks
- 280
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 2
Description
Please answer these questions before submitting a bug report.
### What version of godog are you using?
```
> godog version
Godog version is: v0.12.0
```
### What version of Go are you using?
```
> go version
go version go1.15.15 linux/amd64
```
### What did you do?
First add a /test folder and executed `godog`.
This provides me godog example steps -> :+1:
Then added the example code in a `test.go` file and ran godog again
### What did you expect to see?
- Execution of the steps and that godog shows the implementation is still `godog.ErrPending`
### What did you see instead?
`failed to compile testmain package: exit status 1 - output: compile: -importcfg: open /tmp/go-build685074617/b001/importcfg.link: no such file or directory`
### Additional context
After lots of struggle, I found out that I had to rename the `test.go` file to `test_test.go` :exclamation:
- now I'm indeed seeing the expected results.
:red_circle: Strong request: Can the error message `failed to compile testmain package: exit status 1` possibly become more helpful, for example telling me that I'm still missing an actual file that ends in `_test.go` ? A more helpful message would have gotten me back on track way sooner then the cryptic error message that is currently being displayed.
Contributor guide
Research direction
Reproduce the failure by creating a test folder with test.go and running godog, then compare it with the working test_test.go case. Start from the godog command path that reports “failed to compile testmain package” and inspect how the compiler output is surfaced. Done means a missing _test.go file produces a more helpful message while the existing working case still runs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100