Uploaded image for project: 'SonarSlang'
  1. SonarSlang
  2. SONARSLANG-470

[Go] Coverage: "go test" report does not prefix absolute path using '_' anymore

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.8
    • Component/s: Go
    • Labels:
      None

      Description

      go 1.10 test report, for projects outside GOPATH, prefix absolute path using '_'.

      $ go test -coverprofile=coverage.out
      PASS
      coverage: 50.0% of statements
      ok  	_/home/alban/tmp/support/go/test-go	0.004s
      $ cat coverage.out 
      mode: set
      _/home/alban/tmp/support/go/test-go/main.go:5.26,7.2 1 1
      _/home/alban/tmp/support/go/test-go/main.go:9.13,11.2 1 0
      

      But newer go versions (tested using 1.11.4 and 1.13.4) does not use this prefix anymore:

      $ cat coverage.out 
      mode: set
      /home/alban/tmp/support/go/test-go/main.go:5.26,7.2 1 1
      /home/alban/tmp/support/go/test-go/main.go:9.13,11.2 1 0
      

      SonarGo logic to resolve '_' prefixed absolute path does not work anymore and should be fixed. Only relative paths to GOPATH are resolved correctly.

        Attachments

          Activity

            People

            Assignee:
            costin.zaharia Costin Zaharia
            Reporter:
            alban.auzeill Alban Auzeill
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: