Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add summary to smoketests #3288

Merged
merged 2 commits into from
Jun 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}`);
rishabh3112 marked this conversation as resolved.
Show resolved Hide resolved
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