From 4c55ca8e50fb3c5f0cdfa78bd941285c18f1da57 Mon Sep 17 00:00:00 2001 From: Rishabh Chawla Date: Fri, 10 Jun 2022 09:56:41 +0530 Subject: [PATCH 1/2] feat: add summary to smoketests --- .cspell.json | 3 ++- smoketests/index.js | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.cspell.json b/.cspell.json index 1d3158fc34a..e7554b656c9 100644 --- a/.cspell.json +++ b/.cspell.json @@ -91,7 +91,8 @@ "Zenitsu", "eslintcache", "wagoid", - "Nitin" + "Nitin", + "smoketest" ], "dictionaries": ["npm", "software-terms"], "ignorePaths": [ diff --git a/smoketests/index.js b/smoketests/index.js index 8441c4d3ad2..c7de423b545 100644 --- a/smoketests/index.js +++ b/smoketests/index.js @@ -11,6 +11,7 @@ const tests = [ (async () => { let isAllPassed = true; + const allResults = []; for await (const test of tests) { console.log(`\nRUN ${test.name}`); @@ -22,13 +23,22 @@ const tests = [ } if (!isPass) { - console.log(`FAIL ${test.name}`); + const result = `FAIL ${test.name}`; + allResults.push(result); + console.log(result); isAllPassed = false; } else { - console.log(`PASS ${test.name}`); + const result = `PASS ${test.name}`; + allResults.push(result); + console.log(result); } } + console.log(`\n\nSummary of smoketest run:`); + for (const result of allResults) { + console.log(result); + } + if (!isAllPassed) { process.exit(2); } From b1cb5decdaa5bbe9041dbfbece12e82edb241a9c Mon Sep 17 00:00:00 2001 From: Rishabh Chawla Date: Fri, 10 Jun 2022 10:38:29 +0530 Subject: [PATCH 2/2] chore: add pass fail count --- smoketests/index.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/smoketests/index.js b/smoketests/index.js index c7de423b545..3f5ec06c8c1 100644 --- a/smoketests/index.js +++ b/smoketests/index.js @@ -11,7 +11,8 @@ const tests = [ (async () => { let isAllPassed = true; - const allResults = []; + const passResults = []; + const failResults = []; for await (const test of tests) { console.log(`\nRUN ${test.name}`); @@ -24,18 +25,23 @@ const tests = [ if (!isPass) { const result = `FAIL ${test.name}`; - allResults.push(result); + failResults.push(result); console.log(result); isAllPassed = false; } else { const result = `PASS ${test.name}`; - allResults.push(result); + passResults.push(result); console.log(result); } } console.log(`\n\nSummary of smoketest run:`); - for (const result of allResults) { + console.log(`${failResults.length} tests failed, ${passResults.length} tests passed`); + + for (const result of failResults) { + console.log(result); + } + for (const result of passResults) { console.log(result); }