From 5fb8aae680fce03894f95f7a5001087443c8c916 Mon Sep 17 00:00:00 2001 From: Pablo Caraballo Llorente Date: Fri, 19 Nov 2021 18:00:10 +0100 Subject: [PATCH] ref(*): relocate 'helm dependency list' testing Signed-off-by: Pablo Caraballo Llorente --- cmd/helm/dependency_list_test.go | 77 ++++++++++++++++++ cmd/helm/dependency_test.go | 33 -------- .../output/dependency-list-archive.txt | 1 - .../output/dependency-list-compressed-tgz.txt | 1 - .../output/dependency-list-compressed.txt | 1 - .../output/dependency-list-missing.txt | 3 + .../dependency-list-uncompressed-tgz.txt | 1 - .../output/dependency-list-uncompressed.txt | 1 - cmd/helm/testdata/output/dependency-list.txt | 1 - ...art-with-compressed-dependencies-2.1.8.tgz | Bin .../Chart.yaml | 0 .../charts/mariadb-4.3.1.tgz | Bin .../requirements.lock | 0 .../requirements.yaml | 0 ...t-with-uncompressed-dependencies-2.1.8.tgz | Bin .../.helmignore | 0 .../Chart.yaml | 0 .../README.md | 0 .../charts/mariadb/.helmignore | 0 .../charts/mariadb/Chart.yaml | 0 .../charts/mariadb/README.md | 0 .../docker-entrypoint-initdb.d/README.md | 0 .../charts/mariadb/templates/NOTES.txt | 0 .../charts/mariadb/templates/_helpers.tpl | 0 .../templates/initialization-configmap.yaml | 0 .../mariadb/templates/master-configmap.yaml | 0 .../mariadb/templates/master-statefulset.yaml | 0 .../charts/mariadb/templates/master-svc.yaml | 0 .../charts/mariadb/templates/secrets.yaml | 0 .../mariadb/templates/slave-configmap.yaml | 0 .../mariadb/templates/slave-statefulset.yaml | 0 .../charts/mariadb/templates/slave-svc.yaml | 0 .../charts/mariadb/templates/test-runner.yaml | 0 .../charts/mariadb/templates/tests.yaml | 0 .../charts/mariadb/values.yaml | 0 .../requirements.lock | 0 .../requirements.yaml | 0 .../templates/NOTES.txt | 0 .../values.yaml | 0 pkg/action/dependency_test.go | 38 +-------- .../testdata/output/list-missing-deps.txt | 3 - 41 files changed, 81 insertions(+), 79 deletions(-) create mode 100644 cmd/helm/dependency_list_test.go rename pkg/action/testdata/output/list-compressed-deps-tgz.txt => cmd/helm/testdata/output/dependency-list-compressed-tgz.txt (99%) rename pkg/action/testdata/output/list-compressed-deps.txt => cmd/helm/testdata/output/dependency-list-compressed.txt (99%) create mode 100644 cmd/helm/testdata/output/dependency-list-missing.txt rename pkg/action/testdata/output/list-uncompressed-deps-tgz.txt => cmd/helm/testdata/output/dependency-list-uncompressed-tgz.txt (99%) rename pkg/action/testdata/output/list-uncompressed-deps.txt => cmd/helm/testdata/output/dependency-list-uncompressed.txt (99%) rename {pkg/action/testdata/charts => cmd/helm/testdata/testcharts}/chart-with-compressed-dependencies-2.1.8.tgz (100%) rename {pkg/action/testdata/charts => cmd/helm/testdata/testcharts}/chart-with-compressed-dependencies/Chart.yaml (100%) rename {pkg/action/testdata/charts => cmd/helm/testdata/testcharts}/chart-with-compressed-dependencies/charts/mariadb-4.3.1.tgz (100%) rename {pkg/action/testdata/charts => cmd/helm/testdata/testcharts}/chart-with-compressed-dependencies/requirements.lock (100%) rename {pkg/action/testdata/charts => cmd/helm/testdata/testcharts}/chart-with-compressed-dependencies/requirements.yaml (100%) rename {pkg/action/testdata/charts => cmd/helm/testdata/testcharts}/chart-with-uncompressed-dependencies-2.1.8.tgz (100%) rename {pkg/action/testdata/charts => cmd/helm/testdata/testcharts}/chart-with-uncompressed-dependencies/.helmignore (100%) rename {pkg/action/testdata/charts => cmd/helm/testdata/testcharts}/chart-with-uncompressed-dependencies/Chart.yaml (100%) rename {pkg/action/testdata/charts => cmd/helm/testdata/testcharts}/chart-with-uncompressed-dependencies/README.md (100%) rename {pkg/action/testdata/charts => cmd/helm/testdata/testcharts}/chart-with-uncompressed-dependencies/charts/mariadb/.helmignore (100%) rename {pkg/action/testdata/charts => cmd/helm/testdata/testcharts}/chart-with-uncompressed-dependencies/charts/mariadb/Chart.yaml (100%) rename {pkg/action/testdata/charts => cmd/helm/testdata/testcharts}/chart-with-uncompressed-dependencies/charts/mariadb/README.md (100%) rename {pkg/action/testdata/charts => cmd/helm/testdata/testcharts}/chart-with-uncompressed-dependencies/charts/mariadb/files/docker-entrypoint-initdb.d/README.md (100%) rename {pkg/action/testdata/charts => cmd/helm/testdata/testcharts}/chart-with-uncompressed-dependencies/charts/mariadb/templates/NOTES.txt (100%) rename {pkg/action/testdata/charts => cmd/helm/testdata/testcharts}/chart-with-uncompressed-dependencies/charts/mariadb/templates/_helpers.tpl (100%) rename {pkg/action/testdata/charts => cmd/helm/testdata/testcharts}/chart-with-uncompressed-dependencies/charts/mariadb/templates/initialization-configmap.yaml (100%) rename {pkg/action/testdata/charts => cmd/helm/testdata/testcharts}/chart-with-uncompressed-dependencies/charts/mariadb/templates/master-configmap.yaml (100%) rename {pkg/action/testdata/charts => cmd/helm/testdata/testcharts}/chart-with-uncompressed-dependencies/charts/mariadb/templates/master-statefulset.yaml (100%) rename {pkg/action/testdata/charts => cmd/helm/testdata/testcharts}/chart-with-uncompressed-dependencies/charts/mariadb/templates/master-svc.yaml (100%) rename {pkg/action/testdata/charts => cmd/helm/testdata/testcharts}/chart-with-uncompressed-dependencies/charts/mariadb/templates/secrets.yaml (100%) rename {pkg/action/testdata/charts => cmd/helm/testdata/testcharts}/chart-with-uncompressed-dependencies/charts/mariadb/templates/slave-configmap.yaml (100%) rename {pkg/action/testdata/charts => cmd/helm/testdata/testcharts}/chart-with-uncompressed-dependencies/charts/mariadb/templates/slave-statefulset.yaml (100%) rename {pkg/action/testdata/charts => cmd/helm/testdata/testcharts}/chart-with-uncompressed-dependencies/charts/mariadb/templates/slave-svc.yaml (100%) rename {pkg/action/testdata/charts => cmd/helm/testdata/testcharts}/chart-with-uncompressed-dependencies/charts/mariadb/templates/test-runner.yaml (100%) rename {pkg/action/testdata/charts => cmd/helm/testdata/testcharts}/chart-with-uncompressed-dependencies/charts/mariadb/templates/tests.yaml (100%) rename {pkg/action/testdata/charts => cmd/helm/testdata/testcharts}/chart-with-uncompressed-dependencies/charts/mariadb/values.yaml (100%) rename {pkg/action/testdata/charts => cmd/helm/testdata/testcharts}/chart-with-uncompressed-dependencies/requirements.lock (100%) rename {pkg/action/testdata/charts => cmd/helm/testdata/testcharts}/chart-with-uncompressed-dependencies/requirements.yaml (100%) rename {pkg/action/testdata/charts => cmd/helm/testdata/testcharts}/chart-with-uncompressed-dependencies/templates/NOTES.txt (100%) rename {pkg/action/testdata/charts => cmd/helm/testdata/testcharts}/chart-with-uncompressed-dependencies/values.yaml (100%) delete mode 100644 pkg/action/testdata/output/list-missing-deps.txt diff --git a/cmd/helm/dependency_list_test.go b/cmd/helm/dependency_list_test.go new file mode 100644 index 000000000..9c5dc88e1 --- /dev/null +++ b/cmd/helm/dependency_list_test.go @@ -0,0 +1,77 @@ +/* +Copyright The Helm Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package main + +import ( + "runtime" + "testing" +) + +func TestDependencyListCmd(t *testing.T) { + noSuchChart := cmdTestCase{ + name: "No such chart", + cmd: "dependency list /no/such/chart", + golden: "output/dependency-list-no-chart-linux.txt", + wantError: true, + } + + noDependencies := cmdTestCase{ + name: "No dependencies", + cmd: "dependency list testdata/testcharts/alpine", + golden: "output/dependency-list-no-requirements-linux.txt", + } + + if runtime.GOOS == "windows" { + noSuchChart.golden = "output/dependency-list-no-chart-windows.txt" + noDependencies.golden = "output/dependency-list-no-requirements-windows.txt" + } + + tests := []cmdTestCase{noSuchChart, + noDependencies, { + name: "Dependencies in chart dir", + cmd: "dependency list testdata/testcharts/reqtest", + golden: "output/dependency-list.txt", + }, { + name: "Dependencies in chart archive", + cmd: "dependency list testdata/testcharts/reqtest-0.1.0.tgz", + golden: "output/dependency-list-archive.txt", + }} + runTestCmd(t, tests) +} +func TestList(t *testing.T) { + tests := []cmdTestCase{{ + name: "list deps of chart with compressed dependencies", + cmd: "dep list testdata/testcharts/chart-with-compressed-dependencies", + golden: "output/dependency-list-compressed.txt", + }, { + name: "list deps of archived chart with compressed dependencies", + cmd: "dep list testdata/testcharts/chart-with-compressed-dependencies-2.1.8.tgz", + golden: "output/dependency-list-compressed-tgz.txt", + }, { + name: "list deps of chart with uncompressed dependencies", + cmd: "dep list testdata/testcharts/chart-with-uncompressed-dependencies", + golden: "output/dependency-list-uncompressed.txt", + }, { + name: "list deps of archived chart with uncompressed dependencies", + cmd: "dep list testdata/testcharts/chart-with-uncompressed-dependencies-2.1.8.tgz", + golden: "output/dependency-list-uncompressed-tgz.txt", + }, { + name: "list deps of chart with missing dependencies", + cmd: "dep list testdata/testcharts/chart-missing-deps", + golden: "output/dependency-list-missing.txt", + }} + + runTestCmd(t, tests) +} diff --git a/cmd/helm/dependency_test.go b/cmd/helm/dependency_test.go index 34c6a25e1..5cd51f8c1 100644 --- a/cmd/helm/dependency_test.go +++ b/cmd/helm/dependency_test.go @@ -16,42 +16,9 @@ limitations under the License. package main import ( - "runtime" "testing" ) -func TestDependencyListCmd(t *testing.T) { - noSuchChart := cmdTestCase{ - name: "No such chart", - cmd: "dependency list /no/such/chart", - golden: "output/dependency-list-no-chart-linux.txt", - wantError: true, - } - - noDependencies := cmdTestCase{ - name: "No dependencies", - cmd: "dependency list testdata/testcharts/alpine", - golden: "output/dependency-list-no-requirements-linux.txt", - } - - if runtime.GOOS == "windows" { - noSuchChart.golden = "output/dependency-list-no-chart-windows.txt" - noDependencies.golden = "output/dependency-list-no-requirements-windows.txt" - } - - tests := []cmdTestCase{noSuchChart, - noDependencies, { - name: "Dependencies in chart dir", - cmd: "dependency list testdata/testcharts/reqtest", - golden: "output/dependency-list.txt", - }, { - name: "Dependencies in chart archive", - cmd: "dependency list testdata/testcharts/reqtest-0.1.0.tgz", - golden: "output/dependency-list-archive.txt", - }} - runTestCmd(t, tests) -} - func TestDependencyFileCompletion(t *testing.T) { checkFileCompletion(t, "dependency", false) } diff --git a/cmd/helm/testdata/output/dependency-list-archive.txt b/cmd/helm/testdata/output/dependency-list-archive.txt index ffd4542b0..6c2c0c4c0 100644 --- a/cmd/helm/testdata/output/dependency-list-archive.txt +++ b/cmd/helm/testdata/output/dependency-list-archive.txt @@ -2,4 +2,3 @@ NAME VERSION REPOSITORY STATUS reqsubchart 0.1.0 https://example.com/charts unpacked reqsubchart2 0.2.0 https://example.com/charts unpacked reqsubchart3 >=0.1.0 https://example.com/charts unpacked - diff --git a/pkg/action/testdata/output/list-compressed-deps-tgz.txt b/cmd/helm/testdata/output/dependency-list-compressed-tgz.txt similarity index 99% rename from pkg/action/testdata/output/list-compressed-deps-tgz.txt rename to cmd/helm/testdata/output/dependency-list-compressed-tgz.txt index 6cc526b70..d68b859a5 100644 --- a/pkg/action/testdata/output/list-compressed-deps-tgz.txt +++ b/cmd/helm/testdata/output/dependency-list-compressed-tgz.txt @@ -1,3 +1,2 @@ NAME VERSION REPOSITORY STATUS mariadb 4.x.x https://kubernetes-charts.storage.googleapis.com/ unpacked - diff --git a/pkg/action/testdata/output/list-compressed-deps.txt b/cmd/helm/testdata/output/dependency-list-compressed.txt similarity index 99% rename from pkg/action/testdata/output/list-compressed-deps.txt rename to cmd/helm/testdata/output/dependency-list-compressed.txt index 08597f31e..489d46f31 100644 --- a/pkg/action/testdata/output/list-compressed-deps.txt +++ b/cmd/helm/testdata/output/dependency-list-compressed.txt @@ -1,3 +1,2 @@ NAME VERSION REPOSITORY STATUS mariadb 4.x.x https://charts.helm.sh/stable/ ok - diff --git a/cmd/helm/testdata/output/dependency-list-missing.txt b/cmd/helm/testdata/output/dependency-list-missing.txt new file mode 100644 index 000000000..040064184 --- /dev/null +++ b/cmd/helm/testdata/output/dependency-list-missing.txt @@ -0,0 +1,3 @@ +NAME VERSION REPOSITORY STATUS +reqsubchart 0.1.0 https://example.com/charts unpacked +reqsubchart2 0.2.0 https://example.com/charts missing diff --git a/pkg/action/testdata/output/list-uncompressed-deps-tgz.txt b/cmd/helm/testdata/output/dependency-list-uncompressed-tgz.txt similarity index 99% rename from pkg/action/testdata/output/list-uncompressed-deps-tgz.txt rename to cmd/helm/testdata/output/dependency-list-uncompressed-tgz.txt index 6cc526b70..d68b859a5 100644 --- a/pkg/action/testdata/output/list-uncompressed-deps-tgz.txt +++ b/cmd/helm/testdata/output/dependency-list-uncompressed-tgz.txt @@ -1,3 +1,2 @@ NAME VERSION REPOSITORY STATUS mariadb 4.x.x https://kubernetes-charts.storage.googleapis.com/ unpacked - diff --git a/pkg/action/testdata/output/list-uncompressed-deps.txt b/cmd/helm/testdata/output/dependency-list-uncompressed.txt similarity index 99% rename from pkg/action/testdata/output/list-uncompressed-deps.txt rename to cmd/helm/testdata/output/dependency-list-uncompressed.txt index bc59e825c..45ad8dd87 100644 --- a/pkg/action/testdata/output/list-uncompressed-deps.txt +++ b/cmd/helm/testdata/output/dependency-list-uncompressed.txt @@ -1,3 +1,2 @@ NAME VERSION REPOSITORY STATUS mariadb 4.x.x https://charts.helm.sh/stable/ unpacked - diff --git a/cmd/helm/testdata/output/dependency-list.txt b/cmd/helm/testdata/output/dependency-list.txt index b57c21a21..1dab86f1d 100644 --- a/cmd/helm/testdata/output/dependency-list.txt +++ b/cmd/helm/testdata/output/dependency-list.txt @@ -2,4 +2,3 @@ NAME VERSION REPOSITORY STATUS reqsubchart 0.1.0 https://example.com/charts unpacked reqsubchart2 0.2.0 https://example.com/charts unpacked reqsubchart3 >=0.1.0 https://example.com/charts ok - diff --git a/pkg/action/testdata/charts/chart-with-compressed-dependencies-2.1.8.tgz b/cmd/helm/testdata/testcharts/chart-with-compressed-dependencies-2.1.8.tgz similarity index 100% rename from pkg/action/testdata/charts/chart-with-compressed-dependencies-2.1.8.tgz rename to cmd/helm/testdata/testcharts/chart-with-compressed-dependencies-2.1.8.tgz diff --git a/pkg/action/testdata/charts/chart-with-compressed-dependencies/Chart.yaml b/cmd/helm/testdata/testcharts/chart-with-compressed-dependencies/Chart.yaml similarity index 100% rename from pkg/action/testdata/charts/chart-with-compressed-dependencies/Chart.yaml rename to cmd/helm/testdata/testcharts/chart-with-compressed-dependencies/Chart.yaml diff --git a/pkg/action/testdata/charts/chart-with-compressed-dependencies/charts/mariadb-4.3.1.tgz b/cmd/helm/testdata/testcharts/chart-with-compressed-dependencies/charts/mariadb-4.3.1.tgz similarity index 100% rename from pkg/action/testdata/charts/chart-with-compressed-dependencies/charts/mariadb-4.3.1.tgz rename to cmd/helm/testdata/testcharts/chart-with-compressed-dependencies/charts/mariadb-4.3.1.tgz diff --git a/pkg/action/testdata/charts/chart-with-compressed-dependencies/requirements.lock b/cmd/helm/testdata/testcharts/chart-with-compressed-dependencies/requirements.lock similarity index 100% rename from pkg/action/testdata/charts/chart-with-compressed-dependencies/requirements.lock rename to cmd/helm/testdata/testcharts/chart-with-compressed-dependencies/requirements.lock diff --git a/pkg/action/testdata/charts/chart-with-compressed-dependencies/requirements.yaml b/cmd/helm/testdata/testcharts/chart-with-compressed-dependencies/requirements.yaml similarity index 100% rename from pkg/action/testdata/charts/chart-with-compressed-dependencies/requirements.yaml rename to cmd/helm/testdata/testcharts/chart-with-compressed-dependencies/requirements.yaml diff --git a/pkg/action/testdata/charts/chart-with-uncompressed-dependencies-2.1.8.tgz b/cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies-2.1.8.tgz similarity index 100% rename from pkg/action/testdata/charts/chart-with-uncompressed-dependencies-2.1.8.tgz rename to cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies-2.1.8.tgz diff --git a/pkg/action/testdata/charts/chart-with-uncompressed-dependencies/.helmignore b/cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/.helmignore similarity index 100% rename from pkg/action/testdata/charts/chart-with-uncompressed-dependencies/.helmignore rename to cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/.helmignore diff --git a/pkg/action/testdata/charts/chart-with-uncompressed-dependencies/Chart.yaml b/cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/Chart.yaml similarity index 100% rename from pkg/action/testdata/charts/chart-with-uncompressed-dependencies/Chart.yaml rename to cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/Chart.yaml diff --git a/pkg/action/testdata/charts/chart-with-uncompressed-dependencies/README.md b/cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/README.md similarity index 100% rename from pkg/action/testdata/charts/chart-with-uncompressed-dependencies/README.md rename to cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/README.md diff --git a/pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/.helmignore b/cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/.helmignore similarity index 100% rename from pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/.helmignore rename to cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/.helmignore diff --git a/pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/Chart.yaml b/cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/Chart.yaml similarity index 100% rename from pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/Chart.yaml rename to cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/Chart.yaml diff --git a/pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/README.md b/cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/README.md similarity index 100% rename from pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/README.md rename to cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/README.md diff --git a/pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/files/docker-entrypoint-initdb.d/README.md b/cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/files/docker-entrypoint-initdb.d/README.md similarity index 100% rename from pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/files/docker-entrypoint-initdb.d/README.md rename to cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/files/docker-entrypoint-initdb.d/README.md diff --git a/pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/templates/NOTES.txt b/cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/templates/NOTES.txt similarity index 100% rename from pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/templates/NOTES.txt rename to cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/templates/NOTES.txt diff --git a/pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/templates/_helpers.tpl b/cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/templates/_helpers.tpl similarity index 100% rename from pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/templates/_helpers.tpl rename to cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/templates/_helpers.tpl diff --git a/pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/templates/initialization-configmap.yaml b/cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/templates/initialization-configmap.yaml similarity index 100% rename from pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/templates/initialization-configmap.yaml rename to cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/templates/initialization-configmap.yaml diff --git a/pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/templates/master-configmap.yaml b/cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/templates/master-configmap.yaml similarity index 100% rename from pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/templates/master-configmap.yaml rename to cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/templates/master-configmap.yaml diff --git a/pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/templates/master-statefulset.yaml b/cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/templates/master-statefulset.yaml similarity index 100% rename from pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/templates/master-statefulset.yaml rename to cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/templates/master-statefulset.yaml diff --git a/pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/templates/master-svc.yaml b/cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/templates/master-svc.yaml similarity index 100% rename from pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/templates/master-svc.yaml rename to cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/templates/master-svc.yaml diff --git a/pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/templates/secrets.yaml b/cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/templates/secrets.yaml similarity index 100% rename from pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/templates/secrets.yaml rename to cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/templates/secrets.yaml diff --git a/pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/templates/slave-configmap.yaml b/cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/templates/slave-configmap.yaml similarity index 100% rename from pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/templates/slave-configmap.yaml rename to cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/templates/slave-configmap.yaml diff --git a/pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/templates/slave-statefulset.yaml b/cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/templates/slave-statefulset.yaml similarity index 100% rename from pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/templates/slave-statefulset.yaml rename to cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/templates/slave-statefulset.yaml diff --git a/pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/templates/slave-svc.yaml b/cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/templates/slave-svc.yaml similarity index 100% rename from pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/templates/slave-svc.yaml rename to cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/templates/slave-svc.yaml diff --git a/pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/templates/test-runner.yaml b/cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/templates/test-runner.yaml similarity index 100% rename from pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/templates/test-runner.yaml rename to cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/templates/test-runner.yaml diff --git a/pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/templates/tests.yaml b/cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/templates/tests.yaml similarity index 100% rename from pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/templates/tests.yaml rename to cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/templates/tests.yaml diff --git a/pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/values.yaml b/cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/values.yaml similarity index 100% rename from pkg/action/testdata/charts/chart-with-uncompressed-dependencies/charts/mariadb/values.yaml rename to cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/charts/mariadb/values.yaml diff --git a/pkg/action/testdata/charts/chart-with-uncompressed-dependencies/requirements.lock b/cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/requirements.lock similarity index 100% rename from pkg/action/testdata/charts/chart-with-uncompressed-dependencies/requirements.lock rename to cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/requirements.lock diff --git a/pkg/action/testdata/charts/chart-with-uncompressed-dependencies/requirements.yaml b/cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/requirements.yaml similarity index 100% rename from pkg/action/testdata/charts/chart-with-uncompressed-dependencies/requirements.yaml rename to cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/requirements.yaml diff --git a/pkg/action/testdata/charts/chart-with-uncompressed-dependencies/templates/NOTES.txt b/cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/templates/NOTES.txt similarity index 100% rename from pkg/action/testdata/charts/chart-with-uncompressed-dependencies/templates/NOTES.txt rename to cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/templates/NOTES.txt diff --git a/pkg/action/testdata/charts/chart-with-uncompressed-dependencies/values.yaml b/cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/values.yaml similarity index 100% rename from pkg/action/testdata/charts/chart-with-uncompressed-dependencies/values.yaml rename to cmd/helm/testdata/testcharts/chart-with-uncompressed-dependencies/values.yaml diff --git a/pkg/action/dependency_test.go b/pkg/action/dependency_test.go index b5032a377..e294228f2 100644 --- a/pkg/action/dependency_test.go +++ b/pkg/action/dependency_test.go @@ -17,7 +17,6 @@ limitations under the License. package action import ( - "bytes" "io/ioutil" "os" "path/filepath" @@ -25,45 +24,10 @@ import ( "github.com/stretchr/testify/assert" - "helm.sh/helm/v3/internal/test" "helm.sh/helm/v3/pkg/chart" "helm.sh/helm/v3/pkg/chartutil" ) -func TestList(t *testing.T) { - for _, tcase := range []struct { - chart string - golden string - }{ - { - chart: "testdata/charts/chart-with-compressed-dependencies", - golden: "output/list-compressed-deps.txt", - }, - { - chart: "testdata/charts/chart-with-compressed-dependencies-2.1.8.tgz", - golden: "output/list-compressed-deps-tgz.txt", - }, - { - chart: "testdata/charts/chart-with-uncompressed-dependencies", - golden: "output/list-uncompressed-deps.txt", - }, - { - chart: "testdata/charts/chart-with-uncompressed-dependencies-2.1.8.tgz", - golden: "output/list-uncompressed-deps-tgz.txt", - }, - { - chart: "testdata/charts/chart-missing-deps", - golden: "output/list-missing-deps.txt", - }, - } { - buf := bytes.Buffer{} - if err := NewDependency().List(tcase.chart, &buf); err != nil { - t.Fatal(err) - } - test.AssertGoldenBytes(t, buf.Bytes(), tcase.golden) - } -} - // TestDependencyStatus_Dashes is a regression test to make sure that dashes in // chart names do not cause resolution problems. func TestDependencyStatus_Dashes(t *testing.T) { @@ -98,7 +62,7 @@ func TestDependencyStatus_Dashes(t *testing.T) { } // Now try to get the deps - stat := NewDependency().dependencyStatus(dir, dep, first) + stat := DependencyStatus(dir, dep, first) if stat != "ok" { t.Errorf("Unexpected status: %q", stat) } diff --git a/pkg/action/testdata/output/list-missing-deps.txt b/pkg/action/testdata/output/list-missing-deps.txt deleted file mode 100644 index 03051251e..000000000 --- a/pkg/action/testdata/output/list-missing-deps.txt +++ /dev/null @@ -1,3 +0,0 @@ -NAME VERSION REPOSITORY STATUS -mariadb 4.x.x https://charts.helm.sh/stable/ missing -