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

prevent testing lib from being compiled in #4742

Merged
merged 2 commits into from Aug 1, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions kyaml/filesys/fsondisk_test.go
Expand Up @@ -58,7 +58,8 @@ func TestCleanedAbs_2(t *testing.T) {
req := require.New(t)
fSys, _ := makeTestDir(t)

root := getOSRoot(t)
root, err := getOSRoot()
req.NoError(err)
d, f, err := fSys.CleanedAbs(root)
req.NoError(err)
req.Equal(root, d.String())
Expand Down Expand Up @@ -122,7 +123,8 @@ func TestConfirmDirDisk(t *testing.T) {
err = os.Symlink(filepath.Join(wd, relDir), linkDir)
req.NoError(err)

root := getOSRoot(t)
root, err := getOSRoot()
req.NoError(err)
tests := map[string]*struct {
path string
expected string
Expand Down
Expand Up @@ -8,10 +8,8 @@ package filesys

import (
"path/filepath"
"testing"
)

func getOSRoot(t *testing.T) string {
t.Helper()
return string(filepath.Separator)
func getOSRoot() (string, error) {
return string(filepath.Separator), nil
}
Expand Up @@ -5,16 +5,11 @@ package filesys

import (
"path/filepath"
"testing"

"github.com/stretchr/testify/require"
"golang.org/x/sys/windows"
)

func getOSRoot(t *testing.T) string {
t.Helper()

func getOSRoot() (string, error) {
sysDir, err := windows.GetSystemDirectory()
natasha41575 marked this conversation as resolved.
Show resolved Hide resolved
require.NoError(t, err)
return filepath.VolumeName(sysDir) + `\`
return filepath.VolumeName(sysDir) + `\`, err
natasha41575 marked this conversation as resolved.
Show resolved Hide resolved
}