Skip to content

Commit

Permalink
clean ns if e2e ns exist, Otherwise create new ns
Browse files Browse the repository at this point in the history
Signed-off-by: Yarden Siboni <yasiboni@microsoft.com>
  • Loading branch information
yasiboni committed Mar 11, 2022
1 parent 8043244 commit 431afd7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/scalers/azure-data-explorer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,14 @@ test.before(t => {

sh.config.silent = true

// Create namespace if it doesn't exist
if (sh.exec(`kubectl get namespace ${dataExplorerNamespace}`).code != 0) {
// Clean namespace if it exists. Otherwise, create new one.
if (sh.exec(`kubectl get namespace ${dataExplorerNamespace}`).code === 0) {
t.is(
0,
sh.exec(`kubectl delete all --all -n ${dataExplorerNamespace}`).code,
'Clean namespace should work.')
}
else {
t.is(
0,
sh.exec(`kubectl create namespace ${dataExplorerNamespace}`).code,
Expand Down

0 comments on commit 431afd7

Please sign in to comment.