From 652cc702168faf4fca57443b0890cf70e71ff71d Mon Sep 17 00:00:00 2001 From: Rishabh Chawla Date: Fri, 10 Jun 2022 11:41:20 +0530 Subject: [PATCH] feat: add summary to smoketests (#3288) * feat: add summary to smoketests * chore: add pass fail count --- .cspell.json | 3 ++- smoketests/index.js | 20 ++++++++++++++++++-- 2 files changed, 20 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..3f5ec06c8c1 100644 --- a/smoketests/index.js +++ b/smoketests/index.js @@ -11,6 +11,8 @@ const tests = [ (async () => { let isAllPassed = true; + const passResults = []; + const failResults = []; for await (const test of tests) { console.log(`\nRUN ${test.name}`); @@ -22,13 +24,27 @@ const tests = [ } if (!isPass) { - console.log(`FAIL ${test.name}`); + const result = `FAIL ${test.name}`; + failResults.push(result); + console.log(result); isAllPassed = false; } else { - console.log(`PASS ${test.name}`); + const result = `PASS ${test.name}`; + passResults.push(result); + console.log(result); } } + console.log(`\n\nSummary of smoketest run:`); + 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); + } + if (!isAllPassed) { process.exit(2); }