treesan
treesan

Reputation: 49

Go test coverage for test files in separate module

I'm running gotestsum --junitfile-testcase-classname=short --junitfile-testsuite-name=relative \ -- -coverprofile=coverage.out ./serviceName/...

The structure looks like this:

serviceName
  normalModule
     - file.go
     - file_test.go
  testModule
     - file2_test.go
     - file3_test.go
  otherModule 
     - file3.go
  - file2.go

How can I generate a test report that will account for all corresponding test files outside of its own module?

Note: I am trying to avoid reorg

Tried above command and expected normalModule, otherModule, and serviceName module to report coverage.

Currently the coverage report only shows a coverage for normalModule and skips the rest:

Upvotes: 1

Views: 164

Answers (0)

Related Questions