From f9428817f76a2ab73e2eafd78ad0842b98c0eaac Mon Sep 17 00:00:00 2001 From: ferantivero Date: Fri, 22 Nov 2019 20:46:29 -0700 Subject: [PATCH] add unit test for export format - add coverage for cannonical export format - add new subchart3 for testing purposes solved: #7045 Signed-off-by: ferantivero --- pkg/chartutil/requirements_test.go | 3 +++ .../subpop/charts/subchart3/.helmignore | 22 +++++++++++++++++++ .../subpop/charts/subchart3/Chart.yaml | 5 +++++ .../subpop/charts/subchart3/values.yaml | 4 ++++ .../testdata/subpop/requirements.yaml | 9 ++++++++ pkg/chartutil/testdata/subpop/values.yaml | 9 +++++++- 6 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 pkg/chartutil/testdata/subpop/charts/subchart3/.helmignore create mode 100644 pkg/chartutil/testdata/subpop/charts/subchart3/Chart.yaml create mode 100644 pkg/chartutil/testdata/subpop/charts/subchart3/values.yaml diff --git a/pkg/chartutil/requirements_test.go b/pkg/chartutil/requirements_test.go index 0cd7ccef6..a3d1b3b67 100644 --- a/pkg/chartutil/requirements_test.go +++ b/pkg/chartutil/requirements_test.go @@ -295,6 +295,9 @@ func TestProcessRequirementsImportValues(t *testing.T) { e["SCBexported2A"] = "blaster" e["global.SC1exported2.all.SC1exported3"] = "SC1expstr" + e["SCCdata.SCCstring"] = "mugwort" + e["SCCdata.SCCint"] = "42" + verifyRequirementsImportValues(t, c, v, e) } func verifyRequirementsImportValues(t *testing.T, c *chart.Chart, v *chart.Config, e map[string]string) { diff --git a/pkg/chartutil/testdata/subpop/charts/subchart3/.helmignore b/pkg/chartutil/testdata/subpop/charts/subchart3/.helmignore new file mode 100644 index 000000000..50af03172 --- /dev/null +++ b/pkg/chartutil/testdata/subpop/charts/subchart3/.helmignore @@ -0,0 +1,22 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/pkg/chartutil/testdata/subpop/charts/subchart3/Chart.yaml b/pkg/chartutil/testdata/subpop/charts/subchart3/Chart.yaml new file mode 100644 index 000000000..0dc60c27c --- /dev/null +++ b/pkg/chartutil/testdata/subpop/charts/subchart3/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +appVersion: "1.0" +description: A Helm chart for Kubernetes +name: subchart3 +version: 0.1.0 diff --git a/pkg/chartutil/testdata/subpop/charts/subchart3/values.yaml b/pkg/chartutil/testdata/subpop/charts/subchart3/values.yaml new file mode 100644 index 000000000..e371bd074 --- /dev/null +++ b/pkg/chartutil/testdata/subpop/charts/subchart3/values.yaml @@ -0,0 +1,4 @@ +exports: + data: + SCCdata: + SCCstring: "mugwort" diff --git a/pkg/chartutil/testdata/subpop/requirements.yaml b/pkg/chartutil/testdata/subpop/requirements.yaml index a6ee20f07..eb79ec433 100644 --- a/pkg/chartutil/testdata/subpop/requirements.yaml +++ b/pkg/chartutil/testdata/subpop/requirements.yaml @@ -35,3 +35,12 @@ dependencies: repository: http://localhost:10191 version: 0.1.0 condition: subchart2alias.enabled + + - name: subchart3 + repository: http://localhost:10191 + version: 0.1.0 + condition: subchart3.enabled + import-values: + - data + + diff --git a/pkg/chartutil/testdata/subpop/values.yaml b/pkg/chartutil/testdata/subpop/values.yaml index 68eb1323c..c5da8c511 100644 --- a/pkg/chartutil/testdata/subpop/values.yaml +++ b/pkg/chartutil/testdata/subpop/values.yaml @@ -35,9 +35,16 @@ overridden-chartA-B: SCBstring: "jango" SPextra6: 111 +SCCdata: + SCCstring: "jaberwocky" + SCCint: 42 + tags: front-end: true back-end: false +subchart3: + enabled: false + subchart2alias: - enabled: false \ No newline at end of file + enabled: false