diff --git a/.changeset/gorgeous-months-jog.md b/.changeset/gorgeous-months-jog.md new file mode 100644 index 00000000..bb98073d --- /dev/null +++ b/.changeset/gorgeous-months-jog.md @@ -0,0 +1,5 @@ +--- +"@moonwall/cli": patch +--- + +Fix process exit val diff --git a/packages/cli/package.json b/packages/cli/package.json index 9f1041c2..2947ecb4 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -62,7 +62,7 @@ }, "dependencies": { "@acala-network/chopsticks": "^0.8.4", - "@moonbeam-network/api-augment": "^0.2400.0", + "@moonbeam-network/api-augment": "^0.2500.0", "@moonwall/types": "workspace:*", "@moonwall/util": "workspace:*", "@polkadot/api": "^10.10.1", @@ -92,7 +92,7 @@ "viem": "^1.18.0", "vitest": "1.0.0-beta.3", "web3": "4.2.1", - "web3-providers-ws": "4.0.3", + "web3-providers-ws": "4.0.7", "ws": "^8.14.2", "yaml": "^2.3.3", "yargs": "^17.7.2" diff --git a/packages/cli/src/cmds/entrypoint.ts b/packages/cli/src/cmds/entrypoint.ts index c244d062..4eeb0126 100755 --- a/packages/cli/src/cmds/entrypoint.ts +++ b/packages/cli/src/cmds/entrypoint.ts @@ -91,8 +91,9 @@ yargs(hideBin(process.argv)) async (args) => { if (args.envName) { process.env.MOON_RUN_SCRIPTS = "true"; - await testCmd(args.envName.toString(), { testNamePattern: args.GrepTest }); - process.exit(0); + (await testCmd(args.envName.toString(), { testNamePattern: args.GrepTest })) + ? process.exit(0) + : process.exit(1); } else { console.log("❌ No environment specified"); console.log(`👉 Run 'pnpm moonwall --help' for more information`); diff --git a/packages/cli/src/internal/localNode.ts b/packages/cli/src/internal/localNode.ts index 6061614d..2a119fb4 100644 --- a/packages/cli/src/internal/localNode.ts +++ b/packages/cli/src/internal/localNode.ts @@ -31,7 +31,7 @@ export async function launchNode(cmd: string, args: string[], name: string): Pro const runningNode = execaCommand(`${cmd} ${args.join(" ")}`, { all: true, - cleanup: true, + cleanup: false, detached: false, }).pipeAll(logLocation); @@ -155,7 +155,7 @@ async function checkWebSocketJSONRPC(port: number): Promise { function findPortsByPid(pid: number, retryDelay: number = 10000) { for (;;) { const command = `lsof -i -n -P | grep LISTEN | grep ${pid} || true`; - const { stdout } = execaCommandSync(command, { shell: true }); + const { stdout } = execaCommandSync(command, { shell: true, cleanup: true }); const ports: number[] = []; const lines = stdout.split("\n"); diff --git a/packages/cli/src/lib/globalContext.ts b/packages/cli/src/lib/globalContext.ts index d82cfefb..e7bbb282 100644 --- a/packages/cli/src/lib/globalContext.ts +++ b/packages/cli/src/lib/globalContext.ts @@ -406,7 +406,7 @@ export interface IGlobalContextFoundation { async function isPidRunning(pid: number): Promise { try { - await execaCommand(`ps -p ${pid} -o pid=`); + await execaCommand(`ps -p ${pid} -o pid=`, { cleanup: true }); return true; } catch { return false; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fa0f1d9d..2ef400c1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -58,8 +58,8 @@ importers: specifier: ^0.8.4 version: 0.8.4(@polkadot/util@12.5.1)(debug@4.3.4) '@moonbeam-network/api-augment': - specifier: ^0.2400.0 - version: 0.2400.0 + specifier: ^0.2500.0 + version: 0.2500.0 '@moonwall/types': specifier: workspace:* version: link:../types @@ -148,8 +148,8 @@ importers: specifier: 4.2.1 version: 4.2.1(typescript@5.2.2) web3-providers-ws: - specifier: 4.0.3 - version: 4.0.3 + specifier: 4.0.7 + version: 4.0.7 ws: specifier: ^8.14.2 version: 8.14.2 @@ -1367,6 +1367,11 @@ packages: resolution: {integrity: sha512-Kec+G3ohgRJyt09bsxfWFB2m24cja6aU81o3NICoOOftD1Jrn6EnKRPLilELYFTRZwYYRQT5TcUELRx1JzLicA==} engines: {node: '>=14.0.0'} + /@moonbeam-network/api-augment@0.2500.0: + resolution: {integrity: sha512-HOHQE9FCw9Pft+t5bWKe+c5+mKJ/5ZD1UztJlGBMxg4NRLCdZiKxdbPBiv2OTpRsBRq5v6PD2LaTFayRjXZYNQ==} + engines: {node: '>=14.0.0'} + dev: false + /@noble/curves@1.1.0: resolution: {integrity: sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA==} dependencies: @@ -2028,12 +2033,6 @@ packages: dependencies: '@types/node': 20.8.9 - /@types/ws@8.5.7: - resolution: {integrity: sha512-6UrLjiDUvn40CMrAubXuIVtj2PEfKDffJS7ychvnPU44j+KVeXmdHHTgqcM/dxLUTHxlXHiFM8Skmb8ozGdTnQ==} - dependencies: - '@types/node': 20.8.9 - dev: false - /@types/yargs-parser@21.0.1: resolution: {integrity: sha512-axdPBuLuEJt0c4yI5OZssC19K2Mq1uKdrfZBzuxLvaztgqUtFYZUNw7lETExPYJR9jdEoIg4mb7RQKRQzOkeGQ==} dev: true @@ -7773,13 +7772,6 @@ packages: - encoding - utf-8-validate - /web3-errors@1.1.2: - resolution: {integrity: sha512-qlyuV5r6MzjLasIalVWBIIfW4Y7hBX2bZv8TRnXvI1EjiZ36zIFKgE9RF+/iRBjXmOsvIUQQ2Z9gMvYGfOwUwQ==} - engines: {node: '>=14', npm: '>=6.12.0'} - dependencies: - web3-types: 1.2.0 - dev: false - /web3-errors@1.1.3: resolution: {integrity: sha512-3GA4leG6XsKLmFWe62mIjVgW4GhkJmvd4IaRLgnKtNnqNmx6L9YWysYwgQ09BaD/NmhKN+AtalSVRds8gU+N0w==} engines: {node: '>=14', npm: '>=6.12.0'} @@ -7932,21 +7924,6 @@ packages: web3-utils: 4.0.7 optional: true - /web3-providers-ws@4.0.3: - resolution: {integrity: sha512-V2bYiMvhv+xBYxFdf8V1zGTwhJoAkBQNMECVGNjQIz1qBKuqu6hXHasmkYSJV780LD6qoL58KlfTggjf4SUSaA==} - engines: {node: '>=14', npm: '>=6.12.0'} - dependencies: - '@types/ws': 8.5.7 - isomorphic-ws: 5.0.0(ws@8.14.2) - web3-errors: 1.1.2 - web3-types: 1.2.0 - web3-utils: 4.0.6 - ws: 8.14.2 - transitivePeerDependencies: - - bufferutil - - utf-8-validate - dev: false - /web3-providers-ws@4.0.7: resolution: {integrity: sha512-n4Dal9/rQWjS7d6LjyEPM2R458V8blRm0eLJupDEJOOIBhGYlxw5/4FthZZ/cqB7y/sLVi7K09DdYx2MeRtU5w==} engines: {node: '>=14', npm: '>=6.12.0'} @@ -7973,26 +7950,11 @@ packages: - encoding - utf-8-validate - /web3-types@1.2.0: - resolution: {integrity: sha512-ljx8mrkrOI8fRqvgOdxfpKYoso6n7I8T9LsqXl+Mz2Db0L+2H15an0xgdoWYpKndTPiU2NKRWFiopYifBQzcxQ==} - engines: {node: '>=14', npm: '>=6.12.0'} - dev: false - /web3-types@1.3.0: resolution: {integrity: sha512-ReRq6D0w6Mr6PkC8mtn6JwBgbVAobPFYNWFO994C7LzTNweYQegb0peri5KMpEHQm2iG2tQbiIyAAeseIohc2Q==} engines: {node: '>=14', npm: '>=6.12.0'} requiresBuild: true - /web3-utils@4.0.6: - resolution: {integrity: sha512-nLVtMf9mWTX604XiQQkWZlHLCag9GdHfQtnGJDNaDssTLUx5SpOm1CjhKCHcVcAH/QazEsWcLqUAuyqwKST1kA==} - engines: {node: '>=14', npm: '>=6.12.0'} - dependencies: - ethereum-cryptography: 2.1.2 - web3-errors: 1.1.2 - web3-types: 1.2.0 - web3-validator: 2.0.2 - dev: false - /web3-utils@4.0.7: resolution: {integrity: sha512-sy8S6C2FIa5NNHc8DjND+Fx3S8KDAizuh5RbL1RX3h0PRbFgPfWzF5RfUns8gTt0mjJuOhs/IaDhrZfeTszG5A==} engines: {node: '>=14', npm: '>=6.12.0'} @@ -8003,17 +7965,6 @@ packages: web3-types: 1.3.0 web3-validator: 2.0.3 - /web3-validator@2.0.2: - resolution: {integrity: sha512-9sQ5owd2UldTsva3o3htj2fTPpbmUwb4TfBXhjIkew8FyT0ss3DPI+j3p6XrfdxIVBEQ5r17YUakElDV99aW+A==} - engines: {node: '>=14', npm: '>=6.12.0'} - dependencies: - ethereum-cryptography: 2.1.2 - util: 0.12.5 - web3-errors: 1.1.2 - web3-types: 1.2.0 - zod: 3.22.4 - dev: false - /web3-validator@2.0.3: resolution: {integrity: sha512-fJbAQh+9LSNWy+l5Ze6HABreml8fra98o5+vS073T35jUcLbRZ0IOjF/ZPJhJNbJDt+jP1vseZsc3z3uX9mxxQ==} engines: {node: '>=14', npm: '>=6.12.0'}