Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

go.testFlags when using -args fails because -coverprofile appended to arg list #2457

Closed
345paul opened this issue Apr 23, 2019 · 1 comment
Closed

Comments

@345paul
Copy link

345paul commented Apr 23, 2019

When using custom test flags in the Go extension with the setting go.testFlags, where the custom flags include -args as per https://golang.org/cmd/go/#hdr-Test_packages, the command line generated has -coverprofile added to the end, causing the go test call to fail with:

flag provided but not defined: -coverprofile

The flags defined in the settings.json are:

    "go.testFlags": [
        "-args",
        "-f",
        "${workspaceRoot}/configs/testconfig.yaml",
        "-r",
        "${workspaceRoot}/shippable/testresults"
    ],

The expected command line should be:

/usr/bin/go test -timeout 120s github.com/gluexchange/catalog-manager-svc/pkg/dataaccess/productcatalog/arangodb -coverprofile=/tmp/vscode-goTN0OVm/go-code-cover -args -f path-to-rootdir/configs/testconfig.yaml -r path-to-rootdir/shippable/testresults

The actual command line generated by the Go extension is:

/usr/bin/go test -timeout 120s github.com/gluexchange/catalog-manager-svc/pkg/dataaccess/productcatalog/arangodb -args -f path-to-rootdir/configs/testconfig.yaml -r path-to-rootdir/shippable/testresults -coverprofile=/tmp/vscode-goTN0OVm/go-code-cover

This looked like it had been fixed in the following PR: #1976

But it looks like it might have been regressed by this commit in the goCover.ts file: b44bb8a#diff-869d156f8d53e34e379625eb2aab2d2c

@ramya-rao-a
Copy link
Contributor

This bug is fixed in the lates update (0.11.3) of the Go extension

Thanks for reporting @345paul!

@vscodebot vscodebot bot locked and limited conversation to collaborators Aug 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants