chore: ci should have human readable logs + json for reporting

This commit is contained in:
Danish Arora 2025-01-29 19:34:38 +05:30
parent 62f93dc842
commit 29dd3e225b
No known key found for this signature in database
GPG Key ID: 1C6EF37CDAE1426E
11 changed files with 73 additions and 27 deletions

18
package-lock.json generated
View File

@ -41,6 +41,7 @@
"karma-webkit-launcher": "^2.4.0",
"karma-webpack": "github:codymikol/karma-webpack#2337a82beb078c0d8e25ae8333a06249b8e72828",
"lint-staged": "^15.4.3",
"mocha-multi-reporters": "^1.5.1",
"playwright": "^1.40.1",
"size-limit": "^11.0.1",
"ts-loader": "^9.5.1",
@ -26336,6 +26337,23 @@
"node": ">= 14.0.0"
}
},
"node_modules/mocha-multi-reporters": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/mocha-multi-reporters/-/mocha-multi-reporters-1.5.1.tgz",
"integrity": "sha512-Yb4QJOaGLIcmB0VY7Wif5AjvLMUFAdV57D2TWEva1Y0kU/3LjKpeRVmlMIfuO1SVbauve459kgtIizADqxMWPg==",
"dev": true,
"license": "MIT",
"dependencies": {
"debug": "^4.1.1",
"lodash": "^4.17.15"
},
"engines": {
"node": ">=6.0.0"
},
"peerDependencies": {
"mocha": ">=3.1.2"
}
},
"node_modules/mocha/node_modules/cliui": {
"version": "7.0.4",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",

View File

@ -59,6 +59,7 @@
"karma-webkit-launcher": "^2.4.0",
"karma-webpack": "github:codymikol/karma-webpack#2337a82beb078c0d8e25ae8333a06249b8e72828",
"lint-staged": "^15.4.3",
"mocha-multi-reporters": "^1.5.1",
"playwright": "^1.40.1",
"size-limit": "^11.0.1",
"ts-loader": "^9.5.1",

View File

@ -15,10 +15,13 @@ if (process.env.CI) {
console.log("Running tests in parallel");
config.parallel = true;
config.jobs = 6;
console.log("Using JSON reporter for test results");
config.reporter = 'json';
console.log("Using multi reporters for test results");
config.reporter = 'mocha-multi-reporters';
config.reporterOptions = {
output: 'reports/mocha-results.json'
reporterEnabled: 'spec, json',
jsonReporterOptions: {
output: 'reports/mocha-results.json'
}
};
} else {
console.log("Running tests serially. To enable parallel execution update mocha config");

View File

@ -15,10 +15,13 @@ if (process.env.CI) {
console.log("Running tests in parallel");
config.parallel = true;
config.jobs = 6;
console.log("Using JSON reporter for test results");
config.reporter = 'json';
console.log("Using multi reporters for test results");
config.reporter = 'mocha-multi-reporters';
config.reporterOptions = {
output: 'reports/mocha-results.json'
reporterEnabled: 'spec, json',
jsonReporterOptions: {
output: 'reports/mocha-results.json'
}
};
} else {
console.log("Running tests serially. To enable parallel execution update mocha config");

View File

@ -15,10 +15,13 @@ if (process.env.CI) {
console.log("Running tests in parallel");
config.parallel = true;
config.jobs = 6;
console.log("Using JSON reporter for test results");
config.reporter = 'json';
console.log("Using multi reporters for test results");
config.reporter = 'mocha-multi-reporters';
config.reporterOptions = {
output: 'reports/mocha-results.json'
reporterEnabled: 'spec, json',
jsonReporterOptions: {
output: 'reports/mocha-results.json'
}
};
} else {
console.log("Running tests serially. To enable parallel execution update mocha config");

View File

@ -15,10 +15,13 @@ if (process.env.CI) {
console.log("Running tests in parallel");
config.parallel = true;
config.jobs = 6;
console.log("Using JSON reporter for test results");
config.reporter = 'json';
console.log("Using multi reporters for test results");
config.reporter = 'mocha-multi-reporters';
config.reporterOptions = {
output: 'reports/mocha-results.json'
reporterEnabled: 'spec, json',
jsonReporterOptions: {
output: 'reports/mocha-results.json'
}
};
} else {
console.log("Running tests serially. To enable parallel execution update mocha config");

View File

@ -15,10 +15,13 @@ if (process.env.CI) {
console.log("Running tests in parallel");
config.parallel = true;
config.jobs = 6;
console.log("Using JSON reporter for test results");
config.reporter = 'json';
console.log("Using multi reporters for test results");
config.reporter = 'mocha-multi-reporters';
config.reporterOptions = {
output: 'reports/mocha-results.json'
reporterEnabled: 'spec, json',
jsonReporterOptions: {
output: 'reports/mocha-results.json'
}
};
} else {
console.log("Running tests serially. To enable parallel execution update mocha config");

View File

@ -15,10 +15,13 @@ if (process.env.CI) {
console.log("Running tests in parallel");
config.parallel = true;
config.jobs = 6;
console.log("Using JSON reporter for test results");
config.reporter = 'json';
console.log("Using multi reporters for test results");
config.reporter = 'mocha-multi-reporters';
config.reporterOptions = {
output: 'reports/mocha-results.json'
reporterEnabled: 'spec, json',
jsonReporterOptions: {
output: 'reports/mocha-results.json'
}
};
} else {
console.log("Running tests serially. To enable parallel execution update mocha config");

View File

@ -15,10 +15,13 @@ if (process.env.CI) {
console.log("Running tests in parallel");
config.parallel = true;
config.jobs = 6;
console.log("Using JSON reporter for test results");
config.reporter = 'json';
console.log("Using multi reporters for test results");
config.reporter = 'mocha-multi-reporters';
config.reporterOptions = {
output: 'reports/mocha-results.json'
reporterEnabled: 'spec, json',
jsonReporterOptions: {
output: 'reports/mocha-results.json'
}
};
} else {
console.log("Running tests serially. To enable parallel execution update mocha config");

View File

@ -14,10 +14,13 @@ if (process.env.CI) {
console.log("Running tests in parallel");
config.parallel = true;
config.jobs = 6;
console.log("Using JSON reporter for test results");
config.reporter = 'json';
console.log("Using multi reporters for test results");
config.reporter = 'mocha-multi-reporters';
config.reporterOptions = {
output: 'reports/mocha-results.json'
reporterEnabled: 'spec, json',
jsonReporterOptions: {
output: 'reports/mocha-results.json'
}
};
} else {
console.log("Running tests serially. To enable parallel execution update mocha config");

View File

@ -15,10 +15,13 @@ if (process.env.CI) {
console.log("Running tests in parallel");
config.parallel = true;
config.jobs = 6;
console.log("Using JSON reporter for test results");
config.reporter = 'json';
console.log("Using multi reporters for test results");
config.reporter = 'mocha-multi-reporters';
config.reporterOptions = {
output: 'reports/mocha-results.json'
reporterEnabled: 'spec, json',
jsonReporterOptions: {
output: 'reports/mocha-results.json'
}
};
} else {
console.log("Running tests serially. To enable parallel execution update mocha config");