Skip to content

Commit

Permalink
test: update helm install logic for upgrade tests (#1041)
Browse files Browse the repository at this point in the history
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
  • Loading branch information
aramase committed Dec 15, 2022
1 parent 12ab1a3 commit de6c0c5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
8 changes: 3 additions & 5 deletions .pipelines/templates/e2e-test.yaml
Expand Up @@ -3,7 +3,7 @@ parameters:
type: string
- name: testReleasedVersion
type: boolean
default: false
default: false
- name: resetImageVersion
type: boolean
default: false
Expand Down Expand Up @@ -47,9 +47,7 @@ steps:
export REGISTRY="${REGISTRY:-$(REGISTRY_NAME).azurecr.io/k8s/csi/secrets-store}"
fi
if [ "${{ parameters.testReleasedVersion }}" == True ] ; then
export HELM_CHART_DIR=charts/csi-secrets-store-provider-azure
else
export HELM_CHART_DIR=manifest_staging/charts/csi-secrets-store-provider-azure
export HELM_CHART_DIR=https://azure.github.io/secrets-store-csi-driver-provider-azure/charts
fi
make e2e-test
displayName: "${{ parameters.testName }}"
Expand All @@ -72,7 +70,7 @@ steps:
CI_KIND_CLUSTER: ${{ parameters.ciKindCluster }}
${{ if parameters.isArcTest }}:
IS_ARC_TEST: ${{ parameters.isArcTest }}
# If the image is a released versions (i.e <= v1.3), it still doesn't support the
# If the image is a released versions (i.e <= v1.3), it still doesn't support the
# split cert/key feature, so we need to skip tests for those versions.
${{ if parameters.testReleasedVersion }}:
GINKGO_SKIP: WriteCertAndKeyInSeparateFiles
1 change: 0 additions & 1 deletion test/e2e/e2e_suite_test.go
Expand Up @@ -103,7 +103,6 @@ var _ = BeforeSuite(func() {
})

var _ = AfterSuite(func() {
// cleanup
defer func() {
// uninstall if it's not Soak Test, not backward compatibility test and if cluster is already upgraded or it's not cluster upgrade test
if !config.IsSoakTest && !config.IsArcTest && !config.IsBackwardCompatibilityTest && (!config.IsUpgradeTest || config.IsClusterUpgraded) {
Expand Down
12 changes: 12 additions & 0 deletions test/e2e/framework/helm/helm.go
Expand Up @@ -20,6 +20,7 @@ const (
// see https://github.com/Azure/secrets-store-csi-driver-provider-azure/issues/596
chartName = "csi-secrets-store-provider-azure"
podIdentityChartName = "pi"
providerChartsRepo = "https://azure.github.io/secrets-store-csi-driver-provider-azure/charts"
)

// InstallInput is the input for Install.
Expand All @@ -41,6 +42,17 @@ func Install(input InstallInput) {
defer os.Chdir(cwd)

chartDir := input.Config.HelmChartDir
// if chartDir is the official helm repo, then add the repo and update so the latest package is used
if chartDir == providerChartsRepo {
args := append([]string{"repo", "add", "csi-secrets-store-provider-azure", providerChartsRepo})
err := helm(args)
Expect(err).To(BeNil())

args = append([]string{"repo", "update"})
err = helm(args)
Expect(err).To(BeNil())
chartDir = "csi-secrets-store-provider-azure/csi-secrets-store-provider-azure"
}

args := append([]string{
"install",
Expand Down

0 comments on commit de6c0c5

Please sign in to comment.