chore: disable paralles runs locally (#1662)

* disable paralles runs locally

* add logs

* add readme info about local execution
This commit is contained in:
Florin Barbu 2023-10-13 17:32:28 +03:00 committed by GitHub
parent ce5a48c13c
commit b96c3bd3e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 15 deletions

View File

@ -8,6 +8,6 @@
], ],
"exit": true, "exit": true,
"retries": 4, "retries": 4,
"parallel": true, "parallel": false,
"jobs": 6 "jobs": 6
} }

View File

@ -40,6 +40,7 @@ Therefore, you need to have `docker` installed on your machine to run the tests.
WAKUNODE_IMAGE=image-name npm run test:node WAKUNODE_IMAGE=image-name npm run test:node
``` ```
- Locally, tests are executed serially, allowing the use of **.only** for focused testing. If you wish to run all tests locally and expedite the process, you can enable parallel execution in the Mocha configuration.
# Running tests in the CI # Running tests in the CI

View File

@ -15,21 +15,29 @@ async function main() {
console.log("Image pulled"); console.log("Image pulled");
} }
const mochaArgs = [
"mocha",
"--require",
"ts-node/register",
"--project",
"./tsconfig.dev.json",
...process.argv.slice(2)
];
// If in CI, add --parallel
if (process.env.CI) {
mochaArgs.push("--parallel");
console.log("Running tests in parallel");
} else {
console.log(
"Running tests serially. To enable parallel execution update mocha config"
);
}
// Run mocha tests // Run mocha tests
const mocha = spawn( const mocha = spawn("npx", mochaArgs, {
"npx", stdio: "inherit"
[ });
"mocha",
"--require",
"ts-node/register",
"--project",
"./tsconfig.dev.json",
...process.argv.slice(2)
],
{
stdio: "inherit"
}
);
mocha.on("error", (error) => { mocha.on("error", (error) => {
console.log(`Error running mocha tests: ${error.message}`); console.log(`Error running mocha tests: ${error.message}`);