Skip to content

Commit

Permalink
zip: fix TestCreateFromDirSpecial/ignore_symlink on wasmtime
Browse files Browse the repository at this point in the history
The wasmtime runtime does not permit absolute symlinks.

More generally: since this is an x-repo, we should not assume anything
in particular about the set of supported operating systems. We should
explicitly list the GOOS values expected to always support symlinks,
rather than the ones that are allowed not to.

Fixes golang/go#60795.

Change-Id: I1749429ac1178f261b4acfd97c0fcf9ec1c2a871
Reviewed-on: https://go-review.googlesource.com/c/mod/+/504075
Reviewed-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
  • Loading branch information
Bryan C. Mills authored and gopherbot committed Jun 16, 2023
1 parent 22d21f4 commit 7603649
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions zip/zip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -537,10 +537,11 @@ func TestCreateFromDirSpecial(t *testing.T) {
setup: func(t *testing.T, tmpDir string) string {
if err := os.Symlink(tmpDir, filepath.Join(tmpDir, "link")); err != nil {
switch runtime.GOOS {
case "plan9", "windows":
t.Skipf("could not create symlink: %v", err)
default:
case "aix", "android", "darwin", "dragonfly", "freebsd", "illumos", "ios", "js", "linux", "netbsd", "openbsd", "solaris":
// Symlinks in tmpDir are always expected to work on these platforms.
t.Fatal(err)
default:
t.Skipf("could not create symlink: %v", err)
}
}
return tmpDir
Expand Down

0 comments on commit 7603649

Please sign in to comment.