[go] cmd/go: move gotoolchain_net real toolchain test to verylongtest

0 views
Skip to first unread message

Gopher Robot (Gerrit)

unread,
4:16 PM (5 hours ago) 4:16 PM
to Michael Matloob, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, golang...@luci-project-accounts.iam.gserviceaccount.com, Dmitri Shuralyov, Dmitri Shuralyov, Michael Matloob, golang-co...@googlegroups.com

Gopher Robot submitted the change with unreviewed changes

Unreviewed changes

8 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:

```
The name of the file: src/cmd/internal/script/scripttest/run.go
Insertions: 4, Deletions: 8.

@@ -7,7 +7,6 @@

import (
"bytes"
- "cmd/internal/robustio"
"cmd/internal/script"
"context"
"fmt"
@@ -256,10 +255,10 @@
t.Fatal(err)
}

- // Call removeAll at the end of the test case in case
+ // Call fixPermissions at the end of the test case in case
// it uses the go modcache, which writes read-only files.
- // removeAll fixes up the permissions before removing the files.
- defer removeAll(t, workdir)
+ // fixPermissions fixes up the permissions so a later removal can succeed.
+ defer fixPermissions(t, workdir)

// Unpack archive.
a, err := txtar.ParseFile(file)
@@ -285,7 +284,7 @@
}
}

-func removeAll(t *testing.T, dir string) {
+func fixPermissions(t *testing.T, dir string) {
t.Helper()

// module cache has 0444 directories;
@@ -298,9 +297,6 @@
}
return nil
})
- if err := robustio.RemoveAll(dir); err != nil {
- t.Error(err)
- }
}

// InitScriptDirs sets up directories for executing a script test.
```

Change information

Commit message:
cmd/go: move part of gotoolchain_net to verylongtest

There is a case in gotoolchain_net that tries to download a real
GOTOOLCHAIN from the network. Move it to verylongtest so that it doesn't
affect the normal cmd/go test suite.

Also modify scripttest.RunTest to make files writable so that we can
clean up modcaches with readonly files.

For #80243
Change-Id: I3148fb07249358c7471dae7a7e1b97d76a6a6964
Reviewed-by: Dmitri Shuralyov <dmit...@google.com>
Reviewed-by: Michael Matloob <mat...@google.com>
Auto-Submit: Michael Matloob <mat...@golang.org>
Reviewed-by: Dmitri Shuralyov <dmit...@golang.org>
Files:
  • M src/cmd/go/internal/verylongtest/script_test.go
  • A src/cmd/go/internal/verylongtest/testdata/script/gotoolchain_net.txt
  • M src/cmd/go/testdata/script/gotoolchain_net.txt
  • M src/cmd/internal/script/scripttest/run.go
Change size: M
Delta: 4 files changed, 59 insertions(+), 23 deletions(-)
Branch: refs/heads/master
Submit Requirements:
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I3148fb07249358c7471dae7a7e1b97d76a6a6964
Gerrit-Change-Number: 796020
Gerrit-PatchSet: 10
Gerrit-Owner: Michael Matloob <mat...@golang.org>
Gerrit-Reviewer: Dmitri Shuralyov <dmit...@golang.org>
Gerrit-Reviewer: Dmitri Shuralyov <dmit...@google.com>
Gerrit-Reviewer: Gopher Robot <go...@golang.org>
Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
Gerrit-Reviewer: Michael Matloob <mat...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages