mirror of https://github.com/waku-org/js-waku.git
chore: disable paralles runs locally (#1662)
* disable paralles runs locally * add logs * add readme info about local execution
This commit is contained in:
parent
ce5a48c13c
commit
b96c3bd3e1
|
@ -8,6 +8,6 @@
|
|||
],
|
||||
"exit": true,
|
||||
"retries": 4,
|
||||
"parallel": true,
|
||||
"parallel": false,
|
||||
"jobs": 6
|
||||
}
|
||||
|
|
|
@ -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
|
||||
```
|
||||
|
||||
- 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
|
||||
|
||||
|
|
|
@ -15,21 +15,29 @@ async function main() {
|
|||
console.log("Image pulled");
|
||||
}
|
||||
|
||||
// Run mocha tests
|
||||
const mocha = spawn(
|
||||
"npx",
|
||||
[
|
||||
const mochaArgs = [
|
||||
"mocha",
|
||||
"--require",
|
||||
"ts-node/register",
|
||||
"--project",
|
||||
"./tsconfig.dev.json",
|
||||
...process.argv.slice(2)
|
||||
],
|
||||
{
|
||||
stdio: "inherit"
|
||||
}
|
||||
];
|
||||
|
||||
// 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
|
||||
const mocha = spawn("npx", mochaArgs, {
|
||||
stdio: "inherit"
|
||||
});
|
||||
|
||||
mocha.on("error", (error) => {
|
||||
console.log(`Error running mocha tests: ${error.message}`);
|
||||
|
|
Loading…
Reference in New Issue