From 08159725c7b541c5bd70747542a996474b122647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Rodr=C3=ADguez?= Date: Fri, 1 Oct 2021 12:56:53 -0400 Subject: [PATCH] [Identity] Fixing types on the Kubernetes manual test (#17910) * [Identity] Fixing types on the Kubernetes manual test * string | unknown -> unknown * awaiting L88 --- .../test/manual-integration/Kubernetes/package.json | 6 +++++- .../test/manual-integration/Kubernetes/run_test.ts | 8 ++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/sdk/identity/identity/test/manual-integration/Kubernetes/package.json b/sdk/identity/identity/test/manual-integration/Kubernetes/package.json index f434226b5369..275c01d0638f 100644 --- a/sdk/identity/identity/test/manual-integration/Kubernetes/package.json +++ b/sdk/identity/identity/test/manual-integration/Kubernetes/package.json @@ -4,7 +4,8 @@ "description": "", "main": "index.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "build": "tsc -p ." }, "author": "", "license": "ISC", @@ -13,5 +14,8 @@ "@types/yargs": "15.0.3", "@azure/identity": "2.0.0-beta.6", "@azure/keyvault-secrets": "^4.0.2" + }, + "devDependencies": { + "typescript": "^4.4.3" } } 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 094769f1555f..132ffb6657cb 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,7 @@ const argv = yargs .help() .alias("help", "h").argv; -async function runCommand(command: string[], exitOnError = true) { +async function runCommand(command: string[], exitOnError = true): Promise { try { if (argv.verbose) { console.log(command); @@ -85,7 +85,7 @@ async function main(): Promise { `image.repository=${argv.repository},image.name=${argv["image-name"]},image.tag=${argv["image-tag"]}` ]; - runCommand(helm_install); + await runCommand(helm_install); // get the name of the test pod let podName = await runCommand([ @@ -96,7 +96,7 @@ async function main(): Promise { "--output=jsonpath='{.items[*].metadata.name}'" ]); - if (podName[0] == "'") { + if (typeof podName === "string" && podName[0] == "'") { podName = podName.slice(1, -1); } @@ -113,7 +113,7 @@ 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], false); + logs = await runCommand(["kubectl", "logs", "-f", podName as string], false); if (!active_pods) break; await sleep(30); }