vscode-go
vscode-go copied to clipboard
testing: Install Tests using the local fake proxy fail with go1.19/1.20
For example, https://github.com/golang/vscode-go/actions/runs/9938240939/job/27450273852
2 failing
1) Installation Tests
Install multiple tools with a local proxy:
AssertionError [ERR_ASSERTION]: installTools failed: [{"tool":{"name":"dlv","importPath":"github.com/go-delve/delve/cmd/dlv","modulePath":"github.com/go-delve/delve","replacedByGopls":false,"isImportant":false,"description":"Go debugger (Delve)","latestVersion":{"options":{},"loose":false,"includePrerelease":false,"raw":"v1.8.3","major":1,"minor":8,"patch":3,"prerelease":[],"build":[],"version":"1.8.3"},"latestVersionTimestamp":"2022-04-26T00:00:00.000Z","minimumGoVersion":{"options":{},"loose":false,"includePrerelease":false,"raw":"1.18.0","major":1,"minor":18,"patch":0,"prerelease":[],"build":[],"version":"1.18.0"}},"reason":"failed to install dlv(github.com/go-delve/delve/cmd/[email protected]): Error: Command failed: /opt/hostedtoolcache/go/1.19.13/x64/bin/go install -v github.com/go-delve/delve/cmd/[email protected]\ngo: github.com/go-delve/delve/cmd/[email protected]: github.com/go-delve/delve/cmd/[email protected]: reading file:///tmp/proxydirwfEYB3/github.com/go-delve/delve/cmd/dlv/@v/v1.22.1.info: no such file or directory\n"}]
+ expected - actual
-false
+true
at runTest (out/test/integration/install.test.js:137:30)
at async Context.<anonymous> (out/test/integration/install.test.js:177:9)
2) Installation Tests
Install multiple tools with a local proxy & GOBIN:
AssertionError [ERR_ASSERTION]: installTools failed: [{"tool":{"name":"dlv","importPath":"github.com/go-delve/delve/cmd/dlv","modulePath":"github.com/go-delve/delve","replacedByGopls":false,"isImportant":false,"description":"Go debugger (Delve)","latestVersion":{"options":{},"loose":false,"includePrerelease":false,"raw":"v1.8.3","major":1,"minor":8,"patch":3,"prerelease":[],"build":[],"version":"1.8.3"},"latestVersionTimestamp":"2022-04-26T00:00:00.000Z","minimumGoVersion":{"options":{},"loose":false,"includePrerelease":false,"raw":"1.18.0","major":1,"minor":18,"patch":0,"prerelease":[],"build":[],"version":"1.18.0"}},"reason":"failed to install dlv(github.com/go-delve/delve/cmd/[email protected]): Error: Command failed: /opt/hostedtoolcache/go/1.19.13/x64/bin/go install -v github.com/go-delve/delve/cmd/[email protected]\ngo: github.com/go-delve/delve/cmd/[email protected]: github.com/go-delve/delve/cmd/[email protected]: reading file:///tmp/proxydirGV4B3c/github.com/go-delve/delve/cmd/dlv/@v/v1.22.1.info: no such file or directory\n"}]
+ expected - actual
-false
+true
at runTest (out/test/integration/install.test.js:137:30)
at async Context.<anonymous> (out/test/integration/install.test.js:183:9)
Error: 2 tests failed.
at /home/runner/work/vscode-go/vscode-go/extension/out/test/integration/index.js:62:27
at done (/home/runner/work/vscode-go/vscode-go/extension/node_modules/mocha/lib/mocha.js:1058:7)
Extension host test runner error Error: 2 tests failed.
at /home/runner/work/vscode-go/vscode-go/extension/out/test/integration/index.js:62:27
at done (/home/runner/work/vscode-go/vscode-go/extension/node_modules/mocha/lib/mocha.js:1058:7)
This is because the tests expect to install dlv@latest, but for go1.19 or go1.20, the extension pins the compatible dlv version https://github.com/golang/vscode-go/blob/61901bbc6123dd9c4eb7ac9195886635968763e0/extension/src/goTools.ts#L76-L78
and they do not exist in the fake local proxy.
The fix is non-trivial and cannot be done before v0.42.0. Since this is a bug in the fake proxy arrangement and the test failure actually indicates the dlv installation with go1.19 or 1.20 pick the intended pinned versions.
Change https://go.dev/cl/598196 mentions this issue: extension/test/integration: disable local dlv install tests
Change https://go.dev/cl/598596 mentions this issue: extension/test/integration: skip broken install test for go1.19/1.20