(t *testing.T)
| 4749 | } |
| 4750 | |
| 4751 | func TestGenerateChartPath(t *testing.T) { |
| 4752 | tests := []struct { |
| 4753 | testName string |
| 4754 | chartName string |
| 4755 | release *ReleaseSpec |
| 4756 | outputDir string |
| 4757 | outputDirTemplate string |
| 4758 | wantErr bool |
| 4759 | expected string |
| 4760 | }{ |
| 4761 | { |
| 4762 | testName: "PathGeneratedWithGivenOutputDirAndDefaultReleaseVersion", |
| 4763 | chartName: "chart-name", |
| 4764 | release: &ReleaseSpec{Name: "release-name"}, |
| 4765 | outputDir: "/output-dir", |
| 4766 | wantErr: false, |
| 4767 | expected: "/output-dir/release-name/chart-name/latest", |
| 4768 | }, |
| 4769 | { |
| 4770 | testName: "PathGeneratedWithGivenOutputDirAndGivenReleaseVersion", |
| 4771 | chartName: "chart-name", |
| 4772 | release: &ReleaseSpec{Name: "release-name", Version: "0.0.0"}, |
| 4773 | outputDir: "/output-dir", |
| 4774 | wantErr: false, |
| 4775 | expected: "/output-dir/release-name/chart-name/0.0.0", |
| 4776 | }, |
| 4777 | { |
| 4778 | testName: "PathGeneratedWithGivenOutputDirAndGivenReleaseNamespace", |
| 4779 | chartName: "chart-name", |
| 4780 | release: &ReleaseSpec{Name: "release-name", Namespace: "release-namespace"}, |
| 4781 | outputDir: "/output-dir", |
| 4782 | wantErr: false, |
| 4783 | expected: "/output-dir/release-namespace/release-name/chart-name/latest", |
| 4784 | }, |
| 4785 | { |
| 4786 | testName: "PathGeneratedWithGivenOutputDirAndGivenReleaseKubeContext", |
| 4787 | chartName: "chart-name", |
| 4788 | release: &ReleaseSpec{Name: "release-name", KubeContext: "kube-context"}, |
| 4789 | outputDir: "/output-dir", |
| 4790 | wantErr: false, |
| 4791 | expected: "/output-dir/kube-context/release-name/chart-name/latest", |
| 4792 | }, |
| 4793 | { |
| 4794 | testName: "PathGeneratedWithGivenOutputDirAndGivenReleaseNamespaceAndGivenReleaseKubeContext", |
| 4795 | chartName: "chart-name", |
| 4796 | release: &ReleaseSpec{Name: "release-name", Namespace: "release-namespace", KubeContext: "kube-context"}, |
| 4797 | outputDir: "/output-dir", |
| 4798 | wantErr: false, |
| 4799 | expected: "/output-dir/release-namespace/kube-context/release-name/chart-name/latest", |
| 4800 | }, |
| 4801 | { |
| 4802 | testName: "PathGeneratedWithGivenOutputDirAndGivenOutputDirTemplateWithFieldNameOutputDir", |
| 4803 | chartName: "chart-name", |
| 4804 | release: &ReleaseSpec{Name: "release-name"}, |
| 4805 | outputDir: "/output-dir", |
| 4806 | outputDirTemplate: "{{ .OutputDir }}", |
| 4807 | wantErr: false, |
| 4808 | expected: "/output-dir", |
nothing calls this directly
no test coverage detected