Skip to content

Commit

Permalink
feat: add summary to smoketests (#3288)
Browse files Browse the repository at this point in the history
* feat: add summary to smoketests

* chore: add pass fail count
  • Loading branch information
rishabh3112 committed Jun 10, 2022
1 parent 1072e38 commit 652cc70
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@
"Zenitsu",
"eslintcache",
"wagoid",
"Nitin"
"Nitin",
"smoketest"
],
"dictionaries": ["npm", "software-terms"],
"ignorePaths": [
Expand Down
20 changes: 18 additions & 2 deletions smoketests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand All @@ -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);
}
Expand Down

0 comments on commit 652cc70

Please sign in to comment.