mirror of
https://github.com/logos-messaging/js-waku.git
synced 2026-01-09 01:03:11 +00:00
* allure test reporting * make reports only for the main job * fail a test for demo * fail a test for demo * revert * fail a test for demo * revert * deploy to allure-jswaku * use PAT * add pat as secret * check if pat exists * debug secrets issue * remove debug steps * debug1 * debug2 * debug3 * debug4 * set reports for all tests * fix after ci run * self review --------- Co-authored-by: Sasha <118575614+weboko@users.noreply.github.com>
47 lines
1.0 KiB
JavaScript
47 lines
1.0 KiB
JavaScript
import { exec, spawn } from "child_process";
|
|
import { promisify } from "util";
|
|
|
|
const execAsync = promisify(exec);
|
|
|
|
const WAKUNODE_IMAGE = process.env.WAKUNODE_IMAGE || "wakuorg/nwaku:v0.21.0";
|
|
|
|
async function main() {
|
|
try {
|
|
await execAsync(`docker inspect ${WAKUNODE_IMAGE}`);
|
|
console.log(`Using local image ${WAKUNODE_IMAGE}`);
|
|
} catch (error) {
|
|
console.log(`Pulling image ${WAKUNODE_IMAGE}`);
|
|
await execAsync(`docker pull ${WAKUNODE_IMAGE}`);
|
|
console.log("Image pulled");
|
|
}
|
|
|
|
const mochaArgs = [
|
|
"mocha",
|
|
"--require",
|
|
"ts-node/register",
|
|
"--project",
|
|
"./tsconfig.dev.json",
|
|
...process.argv.slice(2)
|
|
];
|
|
|
|
// Run mocha tests
|
|
const mocha = spawn("npx", mochaArgs, {
|
|
stdio: "inherit"
|
|
});
|
|
|
|
mocha.on("error", (error) => {
|
|
console.log(`Error running mocha tests: ${error.message}`);
|
|
process.exit(1);
|
|
});
|
|
|
|
mocha.on("exit", (code) => {
|
|
console.log(`Mocha tests exited with code ${code}`);
|
|
process.exit(code || 0);
|
|
});
|
|
}
|
|
|
|
main().catch((error) => {
|
|
console.log(error);
|
|
process.exit(1);
|
|
});
|