diff --git a/sdk/identity/identity/test/manual-integration/Kubernetes/.gitignore b/sdk/identity/identity/test/manual-integration/Kubernetes/.gitignore new file mode 100644 index 000000000000..4e57eef8845b --- /dev/null +++ b/sdk/identity/identity/test/manual-integration/Kubernetes/.gitignore @@ -0,0 +1,2 @@ +*.js +*.js.map diff --git a/sdk/identity/identity/test/manual-integration/Kubernetes/run_test.ts b/sdk/identity/identity/test/manual-integration/Kubernetes/run_test.ts index 132ffb6657cb..384d393bd523 100644 --- a/sdk/identity/identity/test/manual-integration/Kubernetes/run_test.ts +++ b/sdk/identity/identity/test/manual-integration/Kubernetes/run_test.ts @@ -48,7 +48,8 @@ const argv = yargs .help() .alias("help", "h").argv; -async function runCommand(command: string[], exitOnError = true): Promise { +function runCommand(command: string[], exitOnError = true): string | null { + console.log("Running command:", command); try { if (argv.verbose) { console.log(command); @@ -61,11 +62,12 @@ async function runCommand(command: string[], exitOnError = true): Promise { `image.repository=${argv.repository},image.name=${argv["image-name"]},image.tag=${argv["image-tag"]}` ]; - await runCommand(helm_install); + runCommand(helm_install); // get the name of the test pod - let podName = await runCommand([ + let podName = runCommand([ "kubectl", "get", "pods", "--selector=job-name=" + JOB_NAME, "--output=jsonpath='{.items[*].metadata.name}'" - ]); + ]) as string; - if (typeof podName === "string" && podName[0] == "'") { + if (podName[0] == "'") { podName = podName.slice(1, -1); } @@ -113,7 +115,11 @@ async function main(): Promise { for (let x = 0; x < 10; ++x) { // kubectl will return '' when there are no active pods let active_pods = runCommand(count_active_pods); - logs = await runCommand(["kubectl", "logs", "-f", podName as string], false); + const result = runCommand(["kubectl", "logs", "-f", podName], false); + if (result === null) { + break; + } + logs = result; if (!active_pods) break; await sleep(30); }