Skip to content

Commit

Permalink
feat(polkadot): update substrate test tooling
Browse files Browse the repository at this point in the history
Primary Changes
---------------
1. Added correct healthcheck for ledger container
2. Update the Substrate test ledger testcases

Signed-off-by: Anmol Bansal <[email protected]>
  • Loading branch information
AnmolBansalDEV committed Jan 13, 2024
1 parent 56fb9fe commit cf223c8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,8 @@ export class SubstrateTestLedger {

this.publishAllPorts = opts.publishAllPorts;
this._containerId = Optional.empty();
this.imageName =
opts.imageName || "ghcr.io/hyperledger/cactus-substrate-all-in-one";
this.imageTag = opts.imageTag || "2021-09-24---feat-1274";
this.imageName = opts.imageName || "docker.io/anmol02/cactus-substrate-aio";
this.imageTag = opts.imageTag || "2023-10-29";
this.imageFqn = `${this.imageName}:${this.imageTag}`;
this.envVars = opts.envVars || new Map();
this.emitContainerLogs = Bools.isBooleanStrict(opts.emitContainerLogs)
Expand Down Expand Up @@ -104,7 +103,7 @@ export class SubstrateTestLedger {
Healthcheck: {
Test: [
"CMD-SHELL",
`rustup --version && rustc --version && cargo --version`,
`(echo '{"id":1,"jsonrpc":"2.0","method":"system_health","params":[]}' | websocat -n1 ws://127.0.0.1:9944) > /dev/null; echo $?`,
],
Interval: 1000000000, // 1 second
Timeout: 3000000000, // 3 seconds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,6 @@ test(testCase, async (t: Test) => {
publishAllPorts: true,
logLevel: logLevel,
emitContainerLogs: true,
imageName: "ghcr.io/hyperledger/cactus-substrate-all-in-one",
imageTag: "2022-03-29--1496",
envVars: new Map([
["WORKING_DIR", "/var/www/node-template"],
["CONTAINER_NAME", "contracts-node-template-cactus"],
["WS_PORT", "9944"],
["PORT", "9944"],
["DOCKER_PORT", "9944"],
["CARGO_HOME", "/var/www/node-template/.cargo"],
]),
};

const ledger = new SubstrateTestLedger(options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,10 @@ test(testCase, async (t: Test) => {
publishAllPorts: true,
logLevel: logLevel,
emitContainerLogs: true,
imageName: "ghcr.io/hyperledger/cactus-substrate-all-in-one",
imageTag: "2022-03-29--1496",
envVars: new Map([
["WORKING_DIR", "/var/www/node-template"],
["CONTAINER_NAME", "contracts-node-template-cactus"],
["WS_PORT", "9945"],
["PORT", "9944"],
["DOCKER_PORT", "9945"],
["CARGO_HOME", "/var/www/node-template/.cargo"],
]),
};

Expand All @@ -35,15 +30,10 @@ test(testCase, async (t: Test) => {
publishAllPorts: true,
logLevel: logLevel,
emitContainerLogs: true,
imageName: "ghcr.io/hyperledger/cactus-substrate-all-in-one",
imageTag: "2022-03-29--1496",
envVars: new Map([
["WORKING_DIR", "/var/www/node-template"],
["CONTAINER_NAME", "contracts-node-template-cactus"],
["WS_PORT", "9947"],
["PORT", "9946"],
["DOCKER_PORT", "9947"],
["CARGO_HOME", "/var/www/node-template/.cargo"],
]),
};

Expand Down

0 comments on commit cf223c8

Please sign in to comment.