Quellcode durchsuchen

go.crypto/ssh/test: skip tests during -short mode

This proposal effectively disables all the ssh/test tests when run with the -short flag supplied.

For developers and users of this package, there should be no change unless they are in the habbit of always supplying -short, which I belive is untrue.

For the CI dashboard the effect should be that these tests, which are really not portable enough to run reliably on all our various builders, are disabled.

LGTM=adg
R=adg, agl, hanwen
CC=golang-codereviews
https://golang.org/cl/125860043
Dave Cheney vor 11 Jahren
Ursprung
Commit
ed03dad8de
1 geänderte Dateien mit 3 neuen und 0 gelöschten Zeilen
  1. 3 0
      ssh/test/test_unix_test.go

+ 3 - 0
ssh/test/test_unix_test.go

@@ -224,6 +224,9 @@ func writeFile(path string, contents []byte) {
 
 
 // newServer returns a new mock ssh server.
 // newServer returns a new mock ssh server.
 func newServer(t *testing.T) *server {
 func newServer(t *testing.T) *server {
+	if testing.Short() {
+		t.Skip("skipping test due to -short")
+	}
 	dir, err := ioutil.TempDir("", "sshtest")
 	dir, err := ioutil.TempDir("", "sshtest")
 	if err != nil {
 	if err != nil {
 		t.Fatal(err)
 		t.Fatal(err)