test(windows): skip failing tests on windows

Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
This commit is contained in:
Mark Sagi-Kazar 2021-09-22 11:06:45 +02:00 committed by Márk Sági-Kazár
parent 15c88da25c
commit 8b7777d3c6
3 changed files with 21 additions and 0 deletions

View File

@ -13,6 +13,8 @@ import (
)
func TestFinder(t *testing.T) {
skipWindows(t)
t.Parallel()
fsys := fstest.MapFS{

View File

@ -58,6 +58,8 @@ func TestCopyAndInsensitiviseMap(t *testing.T) {
}
func TestAbsPathify(t *testing.T) {
skipWindows(t)
home := userHomeDir()
homer := filepath.Join(home, "homer")
wd, _ := os.Getwd()

View File

@ -302,6 +302,8 @@ func (s *stringValue) String() string {
}
func TestGetConfigFile(t *testing.T) {
skipWindows(t)
t.Run("config file set", func(t *testing.T) {
fs := afero.NewMemMapFs()
@ -438,6 +440,8 @@ func TestGetConfigFile(t *testing.T) {
}
func TestReadInConfig(t *testing.T) {
skipWindows(t)
t.Run("config file set", func(t *testing.T) {
fs := afero.NewMemMapFs()
@ -1808,6 +1812,8 @@ func TestWriteConfigDotEnv(t *testing.T) {
}
func TestSafeWriteConfig(t *testing.T) {
skipWindows(t)
v := New()
fs := afero.NewMemMapFs()
v.SetFs(fs)
@ -1831,6 +1837,8 @@ func TestSafeWriteConfigWithMissingConfigPath(t *testing.T) {
}
func TestSafeWriteConfigWithExistingFile(t *testing.T) {
skipWindows(t)
v := New()
fs := afero.NewMemMapFs()
fs.Create("/test/c.yaml")
@ -1870,6 +1878,8 @@ func TestSafeWriteConfigAsWithExistingFile(t *testing.T) {
}
func TestWriteHiddenFile(t *testing.T) {
skipWindows(t)
v := New()
fs := afero.NewMemMapFs()
fs.Create("/test/.config")
@ -2556,3 +2566,10 @@ func BenchmarkGetBoolFromMap(b *testing.B) {
}
}
}
// Skip some tests on Windows that kept failing when Windows was added to the CI as a target.
func skipWindows(t *testing.T) {
if runtime.GOOS == "windows" {
t.Skip("Skip test on Windows")
}
}