cucumber / cucumber/godog

Go-dog code coverage percentage shows 0.0%

Open
#376 6 comments 0 reactions 0 assignees View on GitHub
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?
```
0.8.0
```

### What version of Go are you using?
```
1.15.7
```

### What did you do?

I'm trying to fetch code coverage on godog feature files(functional test cases). Have executed the below command and made necessary changes to testmain package for integration of godog with go test.
cd functionaltests
go test -v --godog.format=pretty -coverprofile=functionaltests.cov -covermode=atomic >> fcoverageresult.txt
All my test cases ran and i get the below output:

801 scenarios ([32m782 passed[0m, [31m19 failed[0m) 7066 steps ([32m7008 passed[0m, [31m19 failed[0m, [36m39 skipped[0m) 1m1.610143019s

### What did you expect to see?
90% code coverage

### What did you see instead?
coverage: 0.0% of statements

### Additional context

Tried using httptest instead of http as well in the test packages. Still facing the same issue. Any suggestions?

Contributor guide

Open the contributing guide

Research direction

Reproduce the report from functionaltests with the shown go test command and inspect the testmain package changes used to integrate godog with go test. Check why the resulting coverage output reports 0.0% despite the scenarios running, and consider the issue resolved when the command produces a nonzero, accurate coverage percentage without breaking the test run.

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
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.