Skip to content

Commit 16fcfc4

Browse files
committed
wip
1 parent c1bd618 commit 16fcfc4

File tree

20 files changed

+70
-127
lines changed

20 files changed

+70
-127
lines changed

.github/workflows/go.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,23 @@ jobs:
114114
with:
115115
go-version-file: go.work
116116
id: go
117-
- name: Test all modules
118-
run: make test-unit-non-plugin
117+
## Windows has significant differences from POSIX-compliant OS.
118+
## so it only runs tests for the modules that are released.
119+
- name: Test kyaml
120+
run: make test
121+
working-directory: ./kyaml
122+
- name: Test cmd/config
123+
run: make test
124+
working-directory: ./cmd/config
125+
env:
126+
KUSTOMIZE_DOCKER_E2E: false # docker on windows not working well yet
127+
- name: Test api
128+
run: make test
129+
working-directory: ./api
130+
env:
131+
KUSTOMIZE_DOCKER_E2E: false # docker on windows not working well yet
132+
- name: Test kustomize
133+
run: make test
134+
working-directory: ./kustomize
119135
env:
120136
KUSTOMIZE_DOCKER_E2E: false # docker on windows not working well yet

api/internal/loader/fileloader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ func (fl *FileLoader) errIfGitContainmentViolation(
238238
"security; bases in kustomizations found in "+
239239
"cloned git repos must be within the repo, "+
240240
"but base '%s' is outside '%s'",
241-
base, containingRepo.CloneDir())
241+
filepath.ToSlash(base.String()), filepath.ToSlash(containingRepo.CloneDir().String()))
242242
}
243243
return nil
244244
}

api/internal/loader/fileloader_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ whatever
401401
require.NoError(err)
402402
repo := l.Repo()
403403
require.Equal(coRoot, repo)
404-
require.Equal(coRoot+"/"+pathInRepo, l.Root())
404+
require.Equal(coRoot+"/"+pathInRepo, filepath.ToSlash(l.Root()))
405405

406406
_, err = l.New(url)
407407
require.Error(err)

api/internal/localizer/localizer_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// Copyright 2022 The Kubernetes Authors.
22
// SPDX-License-Identifier: Apache-2.0
33

4+
// TODO: Skip on Windows due to this test depends onposix-OS specific filepath.
5+
//go:build !windows
6+
// +build !windows
7+
48
package localizer_test
59

610
import (

api/internal/localizer/locloader_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// Copyright 2022 The Kubernetes Authors.
22
// SPDX-License-Identifier: Apache-2.0
33

4+
// TODO: Skip on Windows due to this test depends onposix-OS specific filepath.
5+
//go:build !windows
6+
// +build !windows
7+
48
package localizer_test
59

610
import (

api/internal/localizer/util_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,8 @@ func TestLocRootPath_SymlinkPath(t *testing.T) {
317317
}
318318

319319
func TestCleanedRelativePath(t *testing.T) {
320+
// Skip on Windows due to path separator differences
321+
testutil.SkipWindows(t)
320322
fSys := filesys.MakeFsInMemory()
321323
// Use platform-appropriate root path
322324
rootPath := string(filepath.Separator) + "root"

api/internal/target/kusttarget_configplugin.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func (kt *KustTarget) configureBuiltinGenerators() (
4949
generatorOrigin = &resource.Origin{
5050
Repo: kt.origin.Repo,
5151
Ref: kt.origin.Ref,
52-
ConfiguredIn: filepath.Join(kt.origin.Path, kt.kustFileName),
52+
ConfiguredIn: filepath.ToSlash(filepath.Join(kt.origin.Path, kt.kustFileName)),
5353
ConfiguredBy: yaml.ResourceIdentifier{
5454
TypeMeta: yaml.TypeMeta{
5555
APIVersion: "builtin",
@@ -58,7 +58,6 @@ func (kt *KustTarget) configureBuiltinGenerators() (
5858
},
5959
}
6060
}
61-
6261
for i := range r {
6362
result = append(result, &resmap.GeneratorWithProperties{Generator: r[i], Origin: generatorOrigin})
6463
}
@@ -92,7 +91,7 @@ func (kt *KustTarget) configureBuiltinTransformers(
9291
transformerOrigin = &resource.Origin{
9392
Repo: kt.origin.Repo,
9493
Ref: kt.origin.Ref,
95-
ConfiguredIn: filepath.Join(kt.origin.Path, kt.kustFileName),
94+
ConfiguredIn: filepath.ToSlash(filepath.Join(kt.origin.Path, kt.kustFileName)),
9695
ConfiguredBy: yaml.ResourceIdentifier{
9796
TypeMeta: yaml.TypeMeta{
9897
APIVersion: "builtin",

api/krusty/accumulation_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
"sigs.k8s.io/kustomize/api/konfig"
1818
"sigs.k8s.io/kustomize/api/krusty"
1919
kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest"
20+
"sigs.k8s.io/kustomize/kyaml/testutil"
2021
)
2122

2223
const validResource = `
@@ -184,6 +185,8 @@ spec:
184185
}
185186

186187
func TestAccumulateResourcesErrors(t *testing.T) {
188+
// Skip on Windows due to posix-OS specific error messages.
189+
testutil.SkipWindows(t)
187190
type testcase struct {
188191
name string
189192
resource string

api/krusty/component_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"sigs.k8s.io/kustomize/api/internal/loader"
1212
"sigs.k8s.io/kustomize/api/konfig"
1313
kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest"
14+
"sigs.k8s.io/kustomize/kyaml/testutil"
1415
)
1516

1617
type FileGen func(kusttest_test.Harness)
@@ -507,6 +508,7 @@ spec:
507508
}
508509

509510
func TestComponentErrors(t *testing.T) {
511+
testutil.SkipWindows(t)
510512
testCases := map[string]struct {
511513
input []FileGen
512514
runPath string

api/krusty/originannotation_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"sigs.k8s.io/kustomize/api/krusty"
1515
kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest"
1616
"sigs.k8s.io/kustomize/kyaml/filesys"
17+
"sigs.k8s.io/kustomize/kyaml/testutil"
1718
)
1819

1920
const generateDeploymentDotSh = `#!/bin/sh
@@ -437,6 +438,7 @@ metadata:
437438
}
438439

439440
func TestAnnoOriginCustomExecGenerator(t *testing.T) {
441+
testutil.SkipWindows(t)
440442
fSys := filesys.MakeFsOnDisk()
441443

442444
th := kusttest_test.MakeHarnessWithFs(t, fSys)
@@ -531,6 +533,7 @@ spec:
531533
}
532534

533535
func TestAnnoOriginCustomInlineExecGenerator(t *testing.T) {
536+
testutil.SkipWindows(t)
534537
fSys := filesys.MakeFsOnDisk()
535538

536539
th := kusttest_test.MakeHarnessWithFs(t, fSys)
@@ -621,6 +624,7 @@ spec:
621624
}
622625

623626
func TestAnnoOriginCustomExecGeneratorWithOverlay(t *testing.T) {
627+
testutil.SkipWindows(t)
624628
fSys := filesys.MakeFsOnDisk()
625629

626630
th := kusttest_test.MakeHarnessWithFs(t, fSys)
@@ -721,6 +725,7 @@ spec:
721725
}
722726

723727
func TestAnnoOriginCustomInlineExecGeneratorWithOverlay(t *testing.T) {
728+
testutil.SkipWindows(t)
724729
fSys := filesys.MakeFsOnDisk()
725730

726731
th := kusttest_test.MakeHarnessWithFs(t, fSys)
@@ -817,6 +822,9 @@ spec:
817822
}
818823

819824
func TestAnnoOriginRemoteBuiltinGenerator(t *testing.T) {
825+
// Skip on Windows: Git's core.autocrlf converts LF to CRLF when cloning,
826+
// which changes file content and results in different ConfigMap hash values
827+
testutil.SkipWindows(t)
820828
fSys := filesys.MakeFsOnDisk()
821829
b := krusty.MakeKustomizer(krusty.MakeDefaultOptions())
822830
tmpDir, err := filesys.NewTmpConfirmedDir()
@@ -1031,6 +1039,7 @@ metadata:
10311039
}
10321040

10331041
func TestAnnoOriginGeneratorInTransformersField(t *testing.T) {
1042+
testutil.SkipWindows(t)
10341043
fSys := filesys.MakeFsOnDisk()
10351044

10361045
th := kusttest_test.MakeHarnessWithFs(t, fSys)
@@ -1093,6 +1102,7 @@ spec:
10931102
}
10941103

10951104
func TestAnnoOriginGeneratorInTransformersFieldWithOverlay(t *testing.T) {
1105+
testutil.SkipWindows(t)
10961106
fSys := filesys.MakeFsOnDisk()
10971107

10981108
th := kusttest_test.MakeHarnessWithFs(t, fSys)

0 commit comments

Comments
 (0)