fix: add shard arg to nwaku in peer management tests (#2005)

This commit is contained in:
Arseniy Klempner 2024-05-09 01:25:35 -07:00 committed by GitHub
parent 21aa22f320
commit 5df41b0adf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 18 additions and 7 deletions

View File

@ -26,7 +26,11 @@ async function main() {
// Run mocha tests // Run mocha tests
const mocha = spawn("npx", mochaArgs, { const mocha = spawn("npx", mochaArgs, {
stdio: "inherit" stdio: "inherit",
env: {
...process.env,
NODE_ENV: "test"
}
}); });
mocha.on("error", (error) => { mocha.on("error", (error) => {

View File

@ -25,6 +25,7 @@ export interface Args {
// `legacyFilter` is required to enable filter v1 with go-waku // `legacyFilter` is required to enable filter v1 with go-waku
legacyFilter?: boolean; legacyFilter?: boolean;
clusterId?: number; clusterId?: number;
shard?: Array<number>;
} }
export interface Ports { export interface Ports {

View File

@ -61,7 +61,8 @@ describe("Static Sharding: Peer Management", function () {
discv5Discovery: true, discv5Discovery: true,
peerExchange: true, peerExchange: true,
relay: true, relay: true,
clusterId: clusterId clusterId: clusterId,
shard: [2]
}); });
const enr1 = (await nwaku1.info()).enrUri; const enr1 = (await nwaku1.info()).enrUri;
@ -72,7 +73,8 @@ describe("Static Sharding: Peer Management", function () {
peerExchange: true, peerExchange: true,
discv5BootstrapNode: enr1, discv5BootstrapNode: enr1,
relay: true, relay: true,
clusterId: clusterId clusterId: clusterId,
shard: [2]
}); });
const enr2 = (await nwaku2.info()).enrUri; const enr2 = (await nwaku2.info()).enrUri;
@ -83,7 +85,8 @@ describe("Static Sharding: Peer Management", function () {
peerExchange: true, peerExchange: true,
discv5BootstrapNode: enr2, discv5BootstrapNode: enr2,
relay: true, relay: true,
clusterId: clusterId clusterId: clusterId,
shard: [2]
}); });
const nwaku3Ma = await nwaku3.getMultiaddrWithId(); const nwaku3Ma = await nwaku3.getMultiaddrWithId();
@ -140,7 +143,8 @@ describe("Static Sharding: Peer Management", function () {
relay: true, relay: true,
discv5Discovery: true, discv5Discovery: true,
peerExchange: true, peerExchange: true,
clusterId: clusterId clusterId: clusterId,
shard: [1]
}); });
const enr1 = (await nwaku1.info()).enrUri; const enr1 = (await nwaku1.info()).enrUri;
@ -151,7 +155,8 @@ describe("Static Sharding: Peer Management", function () {
discv5Discovery: true, discv5Discovery: true,
peerExchange: true, peerExchange: true,
discv5BootstrapNode: enr1, discv5BootstrapNode: enr1,
clusterId: clusterId clusterId: clusterId,
shard: [2]
}); });
const enr2 = (await nwaku2.info()).enrUri; const enr2 = (await nwaku2.info()).enrUri;
@ -162,7 +167,8 @@ describe("Static Sharding: Peer Management", function () {
discv5Discovery: true, discv5Discovery: true,
peerExchange: true, peerExchange: true,
discv5BootstrapNode: enr2, discv5BootstrapNode: enr2,
clusterId: clusterId clusterId: clusterId,
shard: [2]
}); });
const nwaku3Ma = await nwaku3.getMultiaddrWithId(); const nwaku3Ma = await nwaku3.getMultiaddrWithId();