Skip to content

Commit

Permalink
Add sleep for webhook, remove cleanup code.
Browse files Browse the repository at this point in the history
Signed-off-by: Vighnesh Shenoy <vshenoy@microsoft.com>
  • Loading branch information
v-shenoy committed May 9, 2022
1 parent 7eb63b7 commit da1d3f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
14 changes: 0 additions & 14 deletions tests/cleanup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,3 @@ test.serial('Remove KEDA', t => {
}
t.pass('KEDA undeployed successfully using make undeploy command')
})

test.serial('remove azure workload identity kubernetes components', t => {
if (!RUN_WORKLOAD_IDENTITY_TESTS || RUN_WORKLOAD_IDENTITY_TESTS == 'false') {
t.pass('skipping as workload identity tests are disabled')
return
}

t.is(0,
sh.exec(`helm uninstall workload-identity-webhook --namespace ${workloadIdentityNamespace}`).code,
'should be able to uninstall workload identity webhook'
)

sh.exec(`kubectl delete ns ${workloadIdentityNamespace}`)
})
7 changes: 4 additions & 3 deletions tests/setup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const RUN_WORKLOAD_IDENTITY_TESTS = process.env['AZURE_RUN_WORKLOAD_IDENTITY_TES
const workloadIdentityNamespace = "azure-workload-identity-system"

test.before('configure shelljs', () => {
sh.config.silent = false
sh.config.silent = false // TODO - Remove later
})

test.serial('Verify all commands', t => {
Expand Down Expand Up @@ -69,7 +69,7 @@ test.serial('setup and verify azure workload identity kubernetes components', t
'should be able to add Azure AD workload identity helm repo'
)
t.is(0,
sh.exec(`helm repo update`).code,
sh.exec(`helm repo update azure-workload-identity`).code,
"should be able to update"
)

Expand All @@ -91,6 +91,7 @@ test.serial('setup and verify azure workload identity kubernetes components', t
} else if (parsedPods == 2) {
t.log('Workload Identity webhook is ready')
success = true
sh.exec('sleep 120s') // Sleep for some time for webhook to setup properly
break
}
}
Expand Down Expand Up @@ -127,7 +128,7 @@ test.serial('verifyKeda', t => {
}
}


// TODO - Remove later.
t.log(
sh.exec("kubectl get sa keda-operator -n keda -o yaml").stdout
)
Expand Down

0 comments on commit da1d3f5

Please sign in to comment.