test: parameterize waku service node dir/bin

This commit is contained in:
Franck Royer 2022-05-27 20:54:38 +10:00 committed by fryorcraken.eth
parent cd665a1803
commit 5f4e14e56c
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4

View File

@ -22,8 +22,11 @@ import waitForLine from "./log_file";
const dbg = debug("waku:nwaku"); const dbg = debug("waku:nwaku");
const NIM_WAKU_DIR = appRoot + "/nwaku"; const WAKU_SERVICE_NODE_DIR =
const NIM_WAKU_BIN = NIM_WAKU_DIR + "/build/wakunode2"; process.env.WAKU_SERVICE_NODE_DIR ?? appRoot + "/nwaku";
const WAKU_SERVICE_NODE_BIN =
process.env.WAKU_SERVICE_NODE_BIN ??
WAKU_SERVICE_NODE_DIR + "/build/wakunode2";
const NODE_READY_LOG_LINE = "Node setup complete"; const NODE_READY_LOG_LINE = "Node setup complete";
const LOG_DIR = "./log"; const LOG_DIR = "./log";
@ -142,8 +145,8 @@ export class Nwaku {
const argsArray = argsToArray(mergedArgs); const argsArray = argsToArray(mergedArgs);
dbg(`nwaku args: ${argsArray.join(" ")}`); dbg(`nwaku args: ${argsArray.join(" ")}`);
this.process = spawn(NIM_WAKU_BIN, argsArray, { this.process = spawn(WAKU_SERVICE_NODE_BIN, argsArray, {
cwd: NIM_WAKU_DIR, cwd: WAKU_SERVICE_NODE_DIR,
stdio: [ stdio: [
"ignore", // stdin "ignore", // stdin
logFile, // stdout logFile, // stdout