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

x/vuln/cmd/govulncheck: Print tests consistently failing on js/wasm #58018

Closed
bcmills opened this issue Jan 26, 2023 · 1 comment
Closed

x/vuln/cmd/govulncheck: Print tests consistently failing on js/wasm #58018

bcmills opened this issue Jan 26, 2023 · 1 comment
Assignees
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. OS-JS Testing An issue that has been verified to require only test changes, not just a test failure. vulncheck or vulndb Issues for the x/vuln or x/vulndb repo x/vuln

Comments

@bcmills
Copy link
Contributor

bcmills commented Jan 26, 2023

https://build.golang.org/log/ade065c29b6482e89b7ea3233ef1bd979511d0ce:

--- FAIL: TestPrintTextNoVulns (0.00s)
    print_test.go:216: mismatch (-want, +got):
          string(
        - 	"No vulnerabilities found.\n\n=== Informational ===\n\nFound 1 vulnerability in packages that you import, but there are no call\nstacks leading to the use of this vulnerability. You may not need to\ntake any action. See https://pkg.go.dev/golang.org/x/vuln/cmd/go"...,
        + 	"",
          )
--- FAIL: TestPrintTextSource (0.00s)
    print_test.go:282: mismatch (-want, +got):
          string(
        - 	"Your code is affected by 1 vulnerability from 1 module.\n\nVulnerability #1: GO-0000-0001\n  Third-party vulnerability\n\n  More info: https://pkg.go.dev/vuln/GO-0000-0001\n\n  Module: golang.org/vmod\n    Found in: golang.org/vmod@v0.0.1\n    Fixed in: golang.org/"...,
        + 	"",
          )
--- FAIL: TestPrintTextBinary (0.00s)
    print_test.go:338: mismatch (-want, +got):
          string(
        - 	"Your code is affected by 2 vulnerabilities from 1 module and the Go standard library.\n\nVulnerability #1: GO-0000-0001\n  Third-party vulnerability\n\n  More info: https://pkg.go.dev/vuln/GO-0000-0001\n\n  Module: golang.org/vmod\n    Found in: golang.org/vmod@v0"...,
        + 	"",
          )
--- FAIL: TestPrintTextMultiModuleAndStacks (0.00s)
    print_test.go:400: mismatch (-want, +got):
          string(
        - 	"Your code is affected by 1 vulnerability from 2 modules.\n\nVulnerability #1: GO-0000-0001\n  Third-party vulnerability\n\n  More info: https://pkg.go.dev/vuln/GO-0000-0001\n\n  Module: golang.org/vmod\n    Found in: golang.org/vmod@v0.0.1\n    Fixed in: golang.org"...,
        + 	"",
          )
FAIL
FAIL	golang.org/x/vuln/cmd/govulncheck	7.572s

The failing tests were added in CL 462795 (attn @zpavlinovic @jba)

@bcmills bcmills added Testing An issue that has been verified to require only test changes, not just a test failure. OS-JS vulncheck or vulndb Issues for the x/vuln or x/vulndb repo x/vuln labels Jan 26, 2023
@gopherbot gopherbot modified the milestones: Unreleased, vuln/unplanned Jan 26, 2023
@bcmills bcmills added the NeedsFix The path to resolution is known, but the work has not been done. label Jan 26, 2023
@zpavlinovic zpavlinovic self-assigned this Jan 26, 2023
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/463498 mentions this issue: cmd/govulncheck: catch all errors in print tests

softdev050 added a commit to softdev050/Golangvuln that referenced this issue Apr 5, 2023
Also refactor code to avoid redirecting std output in tests. js-wasm
does not support pipes. The simplest fix is to make a simple code
refactoring to expose exactly the logic being tested.

Fixes golang/go#58018

Change-Id: I096190198b5e7d5d5b85fa5d525f9807450724ee
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/463498
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com>
sayjun0505 added a commit to sayjun0505/Golangvuln that referenced this issue Apr 8, 2023
Also refactor code to avoid redirecting std output in tests. js-wasm
does not support pipes. The simplest fix is to make a simple code
refactoring to expose exactly the logic being tested.

Fixes golang/go#58018

Change-Id: I096190198b5e7d5d5b85fa5d525f9807450724ee
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/463498
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com>
stanislavkononiuk added a commit to stanislavkononiuk/Golangvuln that referenced this issue Jun 26, 2023
Also refactor code to avoid redirecting std output in tests. js-wasm
does not support pipes. The simplest fix is to make a simple code
refactoring to expose exactly the logic being tested.

Fixes golang/go#58018

Change-Id: I096190198b5e7d5d5b85fa5d525f9807450724ee
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/463498
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com>
@golang golang locked and limited conversation to collaborators Jan 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. OS-JS Testing An issue that has been verified to require only test changes, not just a test failure. vulncheck or vulndb Issues for the x/vuln or x/vulndb repo x/vuln
Projects
None yet
Development

No branches or pull requests

3 participants