From 886c2ae9541e810c02d09a30eb6acd875ab5530d Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Fri, 28 Jul 2023 21:17:49 +0100 Subject: [PATCH 01/16] chore(NA): replace usages of parseInt with Number on es configs inside @kbn/test --- packages/kbn-test/src/es/es_test_config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/kbn-test/src/es/es_test_config.ts b/packages/kbn-test/src/es/es_test_config.ts index c31728b0fd7d8..2bc923b1602c0 100644 --- a/packages/kbn-test/src/es/es_test_config.ts +++ b/packages/kbn-test/src/es/es_test_config.ts @@ -44,7 +44,7 @@ class EsTestConfig { // have to remove the ":" off protocol protocol: testEsUrl.protocol?.slice(0, -1), hostname: testEsUrl.hostname, - port: parseInt(testEsUrl.port, 10), + port: Number(testEsUrl.port), username: testEsUrl.auth?.split(':')[0], password: testEsUrl.auth?.split(':')[1], auth: testEsUrl.auth, @@ -54,7 +54,7 @@ class EsTestConfig { const username = process.env.TEST_ES_USERNAME || systemIndicesSuperuser.username; const password = process.env.TEST_ES_PASSWORD || systemIndicesSuperuser.password; - const port = process.env.TEST_ES_PORT ? parseInt(process.env.TEST_ES_PORT, 10) : 9220; + const port = process.env.TEST_ES_PORT ? Number(process.env.TEST_ES_PORT) : 9220; if (Number.isNaN(port)) { throw new Error( From 6aee9c2126d8a88efe3ac40d77ce8b0677187c5b Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Sat, 29 Jul 2023 01:32:35 +0100 Subject: [PATCH 02/16] chore(NA): change error msg --- packages/kbn-test/src/es/es_test_config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/kbn-test/src/es/es_test_config.ts b/packages/kbn-test/src/es/es_test_config.ts index 2bc923b1602c0..381f1a1ea3386 100644 --- a/packages/kbn-test/src/es/es_test_config.ts +++ b/packages/kbn-test/src/es/es_test_config.ts @@ -58,7 +58,7 @@ class EsTestConfig { if (Number.isNaN(port)) { throw new Error( - `process.env.TEST_ES_PORT must contain a valid port. given: ${process.env.TEST_ES_PORT}` + `process.env.TEST_ES_PORT must contain a valid port. given: #${process.env.TEST_ES_PORT}# and port #${port}#` ); } From b70ad2309ee79fd0b70370bbab15284eb31b6f91 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Sat, 29 Jul 2023 03:18:46 +0100 Subject: [PATCH 03/16] chore(NA): test changes --- packages/kbn-test/src/es/es_test_config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/kbn-test/src/es/es_test_config.ts b/packages/kbn-test/src/es/es_test_config.ts index 381f1a1ea3386..31843fb05f04a 100644 --- a/packages/kbn-test/src/es/es_test_config.ts +++ b/packages/kbn-test/src/es/es_test_config.ts @@ -54,11 +54,11 @@ class EsTestConfig { const username = process.env.TEST_ES_USERNAME || systemIndicesSuperuser.username; const password = process.env.TEST_ES_PASSWORD || systemIndicesSuperuser.password; - const port = process.env.TEST_ES_PORT ? Number(process.env.TEST_ES_PORT) : 9220; + const port = process.env.TEST_ES_PORT ? Number(String(process.env.TEST_ES_PORT)) : 9220; if (Number.isNaN(port)) { throw new Error( - `process.env.TEST_ES_PORT must contain a valid port. given: #${process.env.TEST_ES_PORT}# and port #${port}#` + `process.env.TEST_ES_PORT must contain a valid port. given: #${process.env.TEST_ES_PORT}# and port #${port}# and inline conversion #${Number(String(process.env.TEST_ES_PORT))}#` ); } From 11ae2aba41668a93aa0bf030391d1defba5408bf Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Sat, 29 Jul 2023 02:24:55 +0000 Subject: [PATCH 04/16] [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' --- packages/kbn-test/src/es/es_test_config.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/kbn-test/src/es/es_test_config.ts b/packages/kbn-test/src/es/es_test_config.ts index 31843fb05f04a..3adff83fa5792 100644 --- a/packages/kbn-test/src/es/es_test_config.ts +++ b/packages/kbn-test/src/es/es_test_config.ts @@ -58,7 +58,9 @@ class EsTestConfig { if (Number.isNaN(port)) { throw new Error( - `process.env.TEST_ES_PORT must contain a valid port. given: #${process.env.TEST_ES_PORT}# and port #${port}# and inline conversion #${Number(String(process.env.TEST_ES_PORT))}#` + `process.env.TEST_ES_PORT must contain a valid port. given: #${ + process.env.TEST_ES_PORT + }# and port #${port}# and inline conversion #${Number(String(process.env.TEST_ES_PORT))}#` ); } From c59b945738d8656345f746690a7cd3a2bb46b385 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Sat, 29 Jul 2023 04:33:13 +0100 Subject: [PATCH 05/16] chore(NA): more parse strategies --- packages/kbn-test/src/es/es_test_config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/kbn-test/src/es/es_test_config.ts b/packages/kbn-test/src/es/es_test_config.ts index 3adff83fa5792..fb968c084b1bd 100644 --- a/packages/kbn-test/src/es/es_test_config.ts +++ b/packages/kbn-test/src/es/es_test_config.ts @@ -60,7 +60,7 @@ class EsTestConfig { throw new Error( `process.env.TEST_ES_PORT must contain a valid port. given: #${ process.env.TEST_ES_PORT - }# and port #${port}# and inline conversion #${Number(String(process.env.TEST_ES_PORT))}#` + }# and port #${port}# and inline conversion #${Number(String(process.env.TEST_ES_PORT))}#; json parse: #${JSON.parse(process.env.TEST_ES_PORT)}#; json parse&number: #${Number(JSON.parse(process.env.TEST_ES_PORT))}#; +sign: #${Number(+process.env.TEST_ES_PORT)}#; number: #${Number(process.env.TEST_ES_PORT)}#` ); } From d3a9451c6e592fe8dd7e7a729ff090fa16bc2813 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Sat, 29 Jul 2023 03:39:13 +0000 Subject: [PATCH 06/16] [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' --- packages/kbn-test/src/es/es_test_config.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/kbn-test/src/es/es_test_config.ts b/packages/kbn-test/src/es/es_test_config.ts index fb968c084b1bd..14941ed6ce420 100644 --- a/packages/kbn-test/src/es/es_test_config.ts +++ b/packages/kbn-test/src/es/es_test_config.ts @@ -60,7 +60,13 @@ class EsTestConfig { throw new Error( `process.env.TEST_ES_PORT must contain a valid port. given: #${ process.env.TEST_ES_PORT - }# and port #${port}# and inline conversion #${Number(String(process.env.TEST_ES_PORT))}#; json parse: #${JSON.parse(process.env.TEST_ES_PORT)}#; json parse&number: #${Number(JSON.parse(process.env.TEST_ES_PORT))}#; +sign: #${Number(+process.env.TEST_ES_PORT)}#; number: #${Number(process.env.TEST_ES_PORT)}#` + }# and port #${port}# and inline conversion #${Number( + String(process.env.TEST_ES_PORT) + )}#; json parse: #${JSON.parse(process.env.TEST_ES_PORT)}#; json parse&number: #${Number( + JSON.parse(process.env.TEST_ES_PORT) + )}#; +sign: #${Number(+process.env.TEST_ES_PORT)}#; number: #${Number( + process.env.TEST_ES_PORT + )}#` ); } From 7d88e9cde70f15c9559641b51225e1296117d092 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Sat, 29 Jul 2023 04:41:05 +0100 Subject: [PATCH 07/16] chore(NA): more debug logs --- packages/kbn-test/src/es/es_test_config.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/kbn-test/src/es/es_test_config.ts b/packages/kbn-test/src/es/es_test_config.ts index 14941ed6ce420..79f84f18e4245 100644 --- a/packages/kbn-test/src/es/es_test_config.ts +++ b/packages/kbn-test/src/es/es_test_config.ts @@ -56,17 +56,14 @@ class EsTestConfig { const port = process.env.TEST_ES_PORT ? Number(String(process.env.TEST_ES_PORT)) : 9220; + console.log(`type of TEST_ES_PORT ${typeof process.env.TEST_ES_PORT}`); + console.log(JSON.stringify(process.env.TEST_ES_PORT)); + if (Number.isNaN(port)) { throw new Error( - `process.env.TEST_ES_PORT must contain a valid port. given: #${ - process.env.TEST_ES_PORT - }# and port #${port}# and inline conversion #${Number( - String(process.env.TEST_ES_PORT) - )}#; json parse: #${JSON.parse(process.env.TEST_ES_PORT)}#; json parse&number: #${Number( - JSON.parse(process.env.TEST_ES_PORT) - )}#; +sign: #${Number(+process.env.TEST_ES_PORT)}#; number: #${Number( + `typeof env var: ${typeof process.env.TEST_ES_PORT} and stringify: ${JSON.stringify(process.env.TEST_ES_PORT)}; process.env.TEST_ES_PORT must contain a valid port. given: #${ process.env.TEST_ES_PORT - )}#` + }# and port #${port}# and inline conversion #${Number(String(process.env.TEST_ES_PORT))}#; json parse: #${JSON.parse(process.env.TEST_ES_PORT)}#; json parse&number: #${Number(JSON.parse(process.env.TEST_ES_PORT))}#; +sign: #${Number(+process.env.TEST_ES_PORT)}#; number: #${Number(process.env.TEST_ES_PORT)}#` ); } From 02301e937a3d69c207f950095c1f13063e3e4946 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Sat, 29 Jul 2023 04:48:40 +0100 Subject: [PATCH 08/16] chore(NA): eslint disable console --- packages/kbn-test/src/es/es_test_config.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/kbn-test/src/es/es_test_config.ts b/packages/kbn-test/src/es/es_test_config.ts index 79f84f18e4245..0445d85998589 100644 --- a/packages/kbn-test/src/es/es_test_config.ts +++ b/packages/kbn-test/src/es/es_test_config.ts @@ -56,7 +56,9 @@ class EsTestConfig { const port = process.env.TEST_ES_PORT ? Number(String(process.env.TEST_ES_PORT)) : 9220; + // eslint-disable-next-line no-console console.log(`type of TEST_ES_PORT ${typeof process.env.TEST_ES_PORT}`); + // eslint-disable-next-line no-console console.log(JSON.stringify(process.env.TEST_ES_PORT)); if (Number.isNaN(port)) { From 0e01179919a092d593f2beba423e696adae51f62 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Sat, 29 Jul 2023 03:54:22 +0000 Subject: [PATCH 09/16] [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' --- packages/kbn-test/src/es/es_test_config.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/kbn-test/src/es/es_test_config.ts b/packages/kbn-test/src/es/es_test_config.ts index 0445d85998589..8bb8fa187dc7c 100644 --- a/packages/kbn-test/src/es/es_test_config.ts +++ b/packages/kbn-test/src/es/es_test_config.ts @@ -63,9 +63,17 @@ class EsTestConfig { if (Number.isNaN(port)) { throw new Error( - `typeof env var: ${typeof process.env.TEST_ES_PORT} and stringify: ${JSON.stringify(process.env.TEST_ES_PORT)}; process.env.TEST_ES_PORT must contain a valid port. given: #${ + `typeof env var: ${typeof process.env.TEST_ES_PORT} and stringify: ${JSON.stringify( process.env.TEST_ES_PORT - }# and port #${port}# and inline conversion #${Number(String(process.env.TEST_ES_PORT))}#; json parse: #${JSON.parse(process.env.TEST_ES_PORT)}#; json parse&number: #${Number(JSON.parse(process.env.TEST_ES_PORT))}#; +sign: #${Number(+process.env.TEST_ES_PORT)}#; number: #${Number(process.env.TEST_ES_PORT)}#` + )}; process.env.TEST_ES_PORT must contain a valid port. given: #${ + process.env.TEST_ES_PORT + }# and port #${port}# and inline conversion #${Number( + String(process.env.TEST_ES_PORT) + )}#; json parse: #${JSON.parse(process.env.TEST_ES_PORT)}#; json parse&number: #${Number( + JSON.parse(process.env.TEST_ES_PORT) + )}#; +sign: #${Number(+process.env.TEST_ES_PORT)}#; number: #${Number( + process.env.TEST_ES_PORT + )}#` ); } From 031a6a32c505ad3707a9a11f7084175d12a5e33e Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Sat, 29 Jul 2023 15:31:46 +0100 Subject: [PATCH 10/16] chore(NA): more logs --- packages/kbn-test/src/es/es_test_config.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/kbn-test/src/es/es_test_config.ts b/packages/kbn-test/src/es/es_test_config.ts index 8bb8fa187dc7c..e7df794a35df4 100644 --- a/packages/kbn-test/src/es/es_test_config.ts +++ b/packages/kbn-test/src/es/es_test_config.ts @@ -60,6 +60,10 @@ class EsTestConfig { console.log(`type of TEST_ES_PORT ${typeof process.env.TEST_ES_PORT}`); // eslint-disable-next-line no-console console.log(JSON.stringify(process.env.TEST_ES_PORT)); + // eslint-disable-next-line no-console + console.log(Number(process.env.TEST_ES_PORT)); + // eslint-disable-next-line no-console + console.log(parseInt(process.env.TEST_ES_PORT)); if (Number.isNaN(port)) { throw new Error( @@ -69,8 +73,6 @@ class EsTestConfig { process.env.TEST_ES_PORT }# and port #${port}# and inline conversion #${Number( String(process.env.TEST_ES_PORT) - )}#; json parse: #${JSON.parse(process.env.TEST_ES_PORT)}#; json parse&number: #${Number( - JSON.parse(process.env.TEST_ES_PORT) )}#; +sign: #${Number(+process.env.TEST_ES_PORT)}#; number: #${Number( process.env.TEST_ES_PORT )}#` From c8ced9fc95bd97da5e2bde78f955f5565dde72e4 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Sat, 29 Jul 2023 15:48:10 +0100 Subject: [PATCH 11/16] chore(na): comments --- packages/kbn-test/src/es/es_test_config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/kbn-test/src/es/es_test_config.ts b/packages/kbn-test/src/es/es_test_config.ts index e7df794a35df4..5c580e31f327b 100644 --- a/packages/kbn-test/src/es/es_test_config.ts +++ b/packages/kbn-test/src/es/es_test_config.ts @@ -64,6 +64,7 @@ class EsTestConfig { console.log(Number(process.env.TEST_ES_PORT)); // eslint-disable-next-line no-console console.log(parseInt(process.env.TEST_ES_PORT)); + // more logs if (Number.isNaN(port)) { throw new Error( From 217e17fc8c3c3ec571c10fa546f786ad7cc6ef85 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Sat, 29 Jul 2023 16:04:02 +0100 Subject: [PATCH 12/16] fix(NA): do not use ansi color outputs when using node as a script interpreter on a bash script --- .buildkite/scripts/steps/artifacts/cloud.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.buildkite/scripts/steps/artifacts/cloud.sh b/.buildkite/scripts/steps/artifacts/cloud.sh index 16f280f68c539..2faf5175b97b7 100644 --- a/.buildkite/scripts/steps/artifacts/cloud.sh +++ b/.buildkite/scripts/steps/artifacts/cloud.sh @@ -69,6 +69,9 @@ export CLOUD_DEPLOYMENT_ELASTICSEARCH_URL=$(ecctl deployment show "$CLOUD_DEPLOY echo "Kibana: $CLOUD_DEPLOYMENT_KIBANA_URL" echo "ES: $CLOUD_DEPLOYMENT_ELASTICSEARCH_URL" +# Disable ansi color output for Node.js as we want to get plain values when executing node as a script runner below +export FORCE_COLOR=0 + export TEST_KIBANA_PROTOCOL=$(node -e "console.log(new URL(process.env.CLOUD_DEPLOYMENT_KIBANA_URL).protocol.replace(':', ''))") export TEST_KIBANA_HOSTNAME=$(node -e "console.log(new URL(process.env.CLOUD_DEPLOYMENT_KIBANA_URL).hostname)") export TEST_KIBANA_PORT=$(node -e "console.log(new URL(process.env.CLOUD_DEPLOYMENT_KIBANA_URL).port || 443)") @@ -81,6 +84,9 @@ export TEST_ES_PORT=$(node -e "console.log(new URL(process.env.CLOUD_DEPLOYMENT_ export TEST_ES_USERNAME="$CLOUD_DEPLOYMENT_USERNAME" export TEST_ES_PASSWORD="$CLOUD_DEPLOYMENT_PASSWORD" +# Enabling ansi color output for Node.js again as we don't need to use it as a script interpreter anymore +export FORCE_COLOR=1 + export TEST_BROWSER_HEADLESS=1 # Error: attempted to use the "es" service to fetch Elasticsearch version info but the request failed: ConnectionError: self signed certificate in certificate chain From b0cb0194aa696dd8f806d583e812080f951e84a3 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Sat, 29 Jul 2023 16:06:33 +0100 Subject: [PATCH 13/16] chore(NA): remove unused logs --- packages/kbn-test/src/es/es_test_config.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/kbn-test/src/es/es_test_config.ts b/packages/kbn-test/src/es/es_test_config.ts index 5c580e31f327b..a48239c6f4623 100644 --- a/packages/kbn-test/src/es/es_test_config.ts +++ b/packages/kbn-test/src/es/es_test_config.ts @@ -62,9 +62,6 @@ class EsTestConfig { console.log(JSON.stringify(process.env.TEST_ES_PORT)); // eslint-disable-next-line no-console console.log(Number(process.env.TEST_ES_PORT)); - // eslint-disable-next-line no-console - console.log(parseInt(process.env.TEST_ES_PORT)); - // more logs if (Number.isNaN(port)) { throw new Error( @@ -74,9 +71,7 @@ class EsTestConfig { process.env.TEST_ES_PORT }# and port #${port}# and inline conversion #${Number( String(process.env.TEST_ES_PORT) - )}#; +sign: #${Number(+process.env.TEST_ES_PORT)}#; number: #${Number( - process.env.TEST_ES_PORT - )}#` + )}#; ); } From 01797b16e342e6bb07c243cf577ab636dab730ca Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Sat, 29 Jul 2023 16:43:35 +0100 Subject: [PATCH 14/16] fix(NA): complete template literal --- packages/kbn-test/src/es/es_test_config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/kbn-test/src/es/es_test_config.ts b/packages/kbn-test/src/es/es_test_config.ts index a48239c6f4623..f2f5a6ae802aa 100644 --- a/packages/kbn-test/src/es/es_test_config.ts +++ b/packages/kbn-test/src/es/es_test_config.ts @@ -71,7 +71,7 @@ class EsTestConfig { process.env.TEST_ES_PORT }# and port #${port}# and inline conversion #${Number( String(process.env.TEST_ES_PORT) - )}#; + )}#;` ); } From fcaac8112febf3cfa403872b0d8509f8d6f04c1c Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Sat, 29 Jul 2023 15:49:48 +0000 Subject: [PATCH 15/16] [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix' --- packages/kbn-test/src/es/es_test_config.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/kbn-test/src/es/es_test_config.ts b/packages/kbn-test/src/es/es_test_config.ts index f2f5a6ae802aa..d71a2962d0f41 100644 --- a/packages/kbn-test/src/es/es_test_config.ts +++ b/packages/kbn-test/src/es/es_test_config.ts @@ -69,9 +69,7 @@ class EsTestConfig { process.env.TEST_ES_PORT )}; process.env.TEST_ES_PORT must contain a valid port. given: #${ process.env.TEST_ES_PORT - }# and port #${port}# and inline conversion #${Number( - String(process.env.TEST_ES_PORT) - )}#;` + }# and port #${port}# and inline conversion #${Number(String(process.env.TEST_ES_PORT))}#;` ); } From 3d7cad6fd3f4952241aa1801dda0128bb7db9db0 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Sat, 29 Jul 2023 23:36:56 +0100 Subject: [PATCH 16/16] chore(NA): remove changes from @kbn/test es test config file --- packages/kbn-test/src/es/es_test_config.ts | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/packages/kbn-test/src/es/es_test_config.ts b/packages/kbn-test/src/es/es_test_config.ts index d71a2962d0f41..c31728b0fd7d8 100644 --- a/packages/kbn-test/src/es/es_test_config.ts +++ b/packages/kbn-test/src/es/es_test_config.ts @@ -44,7 +44,7 @@ class EsTestConfig { // have to remove the ":" off protocol protocol: testEsUrl.protocol?.slice(0, -1), hostname: testEsUrl.hostname, - port: Number(testEsUrl.port), + port: parseInt(testEsUrl.port, 10), username: testEsUrl.auth?.split(':')[0], password: testEsUrl.auth?.split(':')[1], auth: testEsUrl.auth, @@ -54,22 +54,11 @@ class EsTestConfig { const username = process.env.TEST_ES_USERNAME || systemIndicesSuperuser.username; const password = process.env.TEST_ES_PASSWORD || systemIndicesSuperuser.password; - const port = process.env.TEST_ES_PORT ? Number(String(process.env.TEST_ES_PORT)) : 9220; - - // eslint-disable-next-line no-console - console.log(`type of TEST_ES_PORT ${typeof process.env.TEST_ES_PORT}`); - // eslint-disable-next-line no-console - console.log(JSON.stringify(process.env.TEST_ES_PORT)); - // eslint-disable-next-line no-console - console.log(Number(process.env.TEST_ES_PORT)); + const port = process.env.TEST_ES_PORT ? parseInt(process.env.TEST_ES_PORT, 10) : 9220; if (Number.isNaN(port)) { throw new Error( - `typeof env var: ${typeof process.env.TEST_ES_PORT} and stringify: ${JSON.stringify( - process.env.TEST_ES_PORT - )}; process.env.TEST_ES_PORT must contain a valid port. given: #${ - process.env.TEST_ES_PORT - }# and port #${port}# and inline conversion #${Number(String(process.env.TEST_ES_PORT))}#;` + `process.env.TEST_ES_PORT must contain a valid port. given: ${process.env.TEST_ES_PORT}` ); }