jenkinsci / jenkinsci/coverage-model

GO_COV issues with resolving paths

Open
#263 6 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
10
Forks
43
Avg merge
5d 7h
Merged PRs (30d)
6

Description

https://github.com/jenkinsci/coverage-model/blob/2833a793b00e9fabf600049a266eb82a6a5c9ec9/src/main/java/edu/hm/hafner/coverage/parser/GoCovParser.java#L43-L52

In coverage profile output the format is `"/:"`. There's no standard structure how modules and orgs are related to package path.

For example having a report for `example.com/main.go:1` is entirely plausible. I created a small example here https://github.com/egonelbre/exp/blob/main/coverage_example/coverage.out.

Since reimplementing module path discovery logic inside coverage parser seems rather a huge undertaking. Shelling out to `go` is probably not a good idea either, maybe there's a way to pass in arguments to the parser on how to convert package names to paths. e.g. passing in prefixes and how they should be replaced with paths:

```
example.com=./
example.com/submodule=/tmp/submodule
github.com/google/protobuf=./vendor/protobuf
```

---

For context, I finally started migrate from corberatura plugin to coverage plugin and I'm getting errors such as:

```
[Coverage] [-ERROR-] - Source file 'xyz/abc.go' not found
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.