From 4f760a0850d0b4c74e630191b9cf822ecac7e16d Mon Sep 17 00:00:00 2001 From: Donny Xia Date: Thu, 6 May 2021 09:45:11 -0700 Subject: [PATCH 1/4] make result public in function filter --- kyaml/fn/runtime/runtimeutil/runtimeutil.go | 4 ++-- kyaml/fn/runtime/runtimeutil/runtimeutil_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kyaml/fn/runtime/runtimeutil/runtimeutil.go b/kyaml/fn/runtime/runtimeutil/runtimeutil.go index 29e2ea0ad..2454aa4cb 100644 --- a/kyaml/fn/runtime/runtimeutil/runtimeutil.go +++ b/kyaml/fn/runtime/runtimeutil/runtimeutil.go @@ -42,7 +42,7 @@ type FunctionFilter struct { DeferFailure bool // results saves the results emitted from Run - results *yaml.RNode + Results *yaml.RNode // exit saves the error returned from Run exit error @@ -250,7 +250,7 @@ func (c *FunctionFilter) doResults(r *kio.ByteReader) error { } if r.Results != nil { - c.results = r.Results + c.Results = r.Results } return nil } diff --git a/kyaml/fn/runtime/runtimeutil/runtimeutil_test.go b/kyaml/fn/runtime/runtimeutil/runtimeutil_test.go index bafdb5907..bcd6272dd 100644 --- a/kyaml/fn/runtime/runtimeutil/runtimeutil_test.go +++ b/kyaml/fn/runtime/runtimeutil/runtimeutil_test.go @@ -1090,7 +1090,7 @@ metadata: if len(tt.instance.ResultsFile) > 0 { tt.expectedResults = strings.TrimSpace(tt.expectedResults) - results, err := tt.instance.results.String() + results, err := tt.instance.Results.String() if !assert.NoError(t, err) { t.FailNow() } From a46926c1ebc4fec5356aa7e528c7df64260c3ab5 Mon Sep 17 00:00:00 2001 From: Donny Xia Date: Thu, 6 May 2021 09:54:26 -0700 Subject: [PATCH 2/4] Disable tests that use non-exist image --- api/krusty/fnplugin_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/krusty/fnplugin_test.go b/api/krusty/fnplugin_test.go index cef7e6fb2..d7e294cf7 100644 --- a/api/krusty/fnplugin_test.go +++ b/api/krusty/fnplugin_test.go @@ -89,7 +89,7 @@ func skipIfNoDocker(t *testing.T) { } } -func TestFnContainerGenerator(t *testing.T) { +/*func TestFnContainerGenerator(t *testing.T) { skipIfNoDocker(t) // Function plugins should not need the env setup done by MakeEnhancedHarness @@ -403,7 +403,7 @@ spec: cpu: 200m memory: 50M `) -} +}*/ func TestFnContainerTransformerWithConfig(t *testing.T) { skipIfNoDocker(t) From 5bb7364967c5b35057e209a24eabf0a02e43646c Mon Sep 17 00:00:00 2001 From: Donny Xia Date: Thu, 6 May 2021 09:54:35 -0700 Subject: [PATCH 3/4] Fix linter error --- cmd/config/internal/commands/tree_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/config/internal/commands/tree_test.go b/cmd/config/internal/commands/tree_test.go index b6b4ed568..31fe3b70f 100644 --- a/cmd/config/internal/commands/tree_test.go +++ b/cmd/config/internal/commands/tree_test.go @@ -84,11 +84,11 @@ spec: return } - if !assert.Equal(t, fmt.Sprintf(`. + if !assert.Equal(t, `. ├── [f1.yaml] Deployment foo ├── [f1.yaml] Service foo └── [f2.yaml] Deployment bar -`), b.String()) { +`, b.String()) { return } } From 627118c438755c02e9b36d351ae5cb41a0ab9461 Mon Sep 17 00:00:00 2001 From: Donny Xia Date: Thu, 6 May 2021 12:33:17 -0700 Subject: [PATCH 4/4] skip tests instead of comment out --- api/krusty/fnplugin_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/krusty/fnplugin_test.go b/api/krusty/fnplugin_test.go index d7e294cf7..1dd852199 100644 --- a/api/krusty/fnplugin_test.go +++ b/api/krusty/fnplugin_test.go @@ -89,7 +89,8 @@ func skipIfNoDocker(t *testing.T) { } } -/*func TestFnContainerGenerator(t *testing.T) { +func TestFnContainerGenerator(t *testing.T) { + t.Skip("wait for #3881") skipIfNoDocker(t) // Function plugins should not need the env setup done by MakeEnhancedHarness @@ -306,6 +307,7 @@ spec: } func TestFnContainerTransformer(t *testing.T) { + t.Skip("wait for #3881") skipIfNoDocker(t) // Function plugins should not need the env setup done by MakeEnhancedHarness @@ -403,7 +405,7 @@ spec: cpu: 200m memory: 50M `) -}*/ +} func TestFnContainerTransformerWithConfig(t *testing.T) { skipIfNoDocker(t)