Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing: Install Tests using the local fake proxy fail with go1.19/1.20 #3454

Open
hyangah opened this issue Jul 15, 2024 · 2 comments
Open
Milestone

Comments

@hyangah
Copy link
Contributor

hyangah commented Jul 15, 2024

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/dlv@v1.22.1): Error: Command failed: /opt/hostedtoolcache/go/1.19.13/x64/bin/go install -v github.com/go-delve/delve/cmd/dlv@v1.22.1\ngo: github.com/go-delve/delve/cmd/dlv@v1.22.1: github.com/go-delve/delve/cmd/dlv@v1.22.1: 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/dlv@v1.22.1): Error: Command failed: /opt/hostedtoolcache/go/1.19.13/x64/bin/go install -v github.com/go-delve/delve/cmd/dlv@v1.22.1\ngo: github.com/go-delve/delve/cmd/dlv@v1.22.1: github.com/go-delve/delve/cmd/dlv@v1.22.1: 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

if (tool.name === 'dlv') {
if (goVersion.lt('1.19')) return importPath + '@v1.20.2';
if (goVersion.lt('1.21')) return importPath + '@v1.22.1';

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.

@hyangah hyangah added this to the v0.43.0 milestone Jul 15, 2024
@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/598196 mentions this issue: extension/test/integration: disable local dlv install tests

gopherbot pushed a commit that referenced this issue Jul 15, 2024
For go1.19 and go1.20, the extension tries to install a pinned version
of dlv (the last version that is compatible with the old go version).
The local proxy used for testing does not have the pinned version
so the test fails. Ironically this test failure indicates the dlv install
logic works as expected. Since the fix is non-trivial and hard to be
done before v0.42.0 release, skip them in go1.19/go1.20 CI.

For #3454

Change-Id: Iccd9d905ab46adf255c52d82817046d4fb85fe81
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/598196
Commit-Queue: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Hongxiang Jiang <hxjiang@golang.org>
kokoro-CI: kokoro <noreply+kokoro@google.com>
@gopherbot
Copy link
Collaborator

Change https://go.dev/cl/598596 mentions this issue: extension/test/integration: skip broken install test for go1.19/1.20

gopherbot pushed a commit that referenced this issue Jul 16, 2024
For go 1.19 and 1.20, the extension installs old gopls
https://github.com/golang/tools/tree/master/gopls#supported-go-versions

For #3454

Change-Id: Ia72d3d9a21789404e80da1579d2fd85dfc633883
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/598596
Commit-Queue: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Hongxiang Jiang <hxjiang@golang.org>
kokoro-CI: kokoro <noreply+kokoro@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants