all: remove test that runs govulncheck on govulncheck
The only interesting vulnerabilities this test can find are stdlib ones.
We cannot really do much about those. On the other hand, whoever is
developing this module on a go version that is not the latest patch or
top will see a failure. This is annoying so we remove the test.
Change-Id: I3236393354565eb9d682075948330b0612434606
Reviewed-on: https://go-review.googlesource.com/c/vuln/+/589235
Reviewed-by: Maceo Thompson <maceothompson@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
diff --git a/all_test.go b/all_test.go
index ca76a8b..d33d1b1 100644
--- a/all_test.go
+++ b/all_test.go
@@ -9,8 +9,6 @@
import (
"bufio"
- "bytes"
- "context"
"errors"
"io/fs"
"os"
@@ -21,7 +19,6 @@
"golang.org/x/mod/modfile"
"golang.org/x/vuln/internal/testenv"
- "golang.org/x/vuln/scan"
)
// excluded contains the set of modules that x/vuln should not depend on.
@@ -55,33 +52,6 @@
}
}
-func TestGovulncheck(t *testing.T) {
- skipIfShort(t)
- testenv.NeedsGoBuild(t)
-
- var o string
- out := bytes.NewBufferString(o)
- ctx := context.Background()
-
- cmd := scan.Command(ctx, "./...")
- cmd.Stdout = out
- cmd.Stderr = out
- err := cmd.Start()
- if err == nil {
- err = cmd.Wait()
- }
-
- t.Logf("govulncheck finished with std out/err:\n%s", out.String())
- switch err := err.(type) {
- case nil:
- t.Log("govulncheck: no vulnerabilities detected")
- case interface{ ExitCode() int }:
- t.Errorf("govulncheck: unexpected exit code %d and error %v", err.ExitCode(), err)
- default:
- t.Errorf("govulncheck: abruptly failed with error %v", err)
- }
-}
-
func TestVet(t *testing.T) {
rungo(t, "vet", "-all", "./...")
}