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
When using custom test flags in the Go extension with the setting
go.testFlags, where the custom flags include-argsas per https://golang.org/cmd/go/#hdr-Test_packages, the command line generated has-coverprofileadded to the end, causing thego testcall to fail with:The flags defined in the settings.json are:
The expected command line should be:
The actual command line generated by the Go extension is:
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.tsfile: b44bb8a#diff-869d156f8d53e34e379625eb2aab2d2c