diff --git a/.github/workflows/ci-reusable.yml b/.github/workflows/ci-reusable.yml index 55ee294f..a7c08ca9 100644 --- a/.github/workflows/ci-reusable.yml +++ b/.github/workflows/ci-reusable.yml @@ -61,6 +61,8 @@ jobs: run: | npm install npm start & + # Wait for the contracts to be deployed + sleep 5 ## Part 2 Tests ## - name: Contract tests diff --git a/tests/integration/hardhatprocess.nim b/tests/integration/hardhatprocess.nim index 40c7942d..21bf107f 100644 --- a/tests/integration/hardhatprocess.nim +++ b/tests/integration/hardhatprocess.nim @@ -53,6 +53,7 @@ proc openLogFile(node: HardhatProcess, logFilePath: string): IoHandle = method start*(node: HardhatProcess) {.async.} = let poptions = node.processOptions + {AsyncProcessOption.StdErrToStdOut} + trace "starting node", args = node.arguments, executable = node.executable, @@ -63,10 +64,28 @@ method start*(node: HardhatProcess) {.async.} = node.process = await startProcess( node.executable, node.workingDir, - @["node", "--export", "deployment-localhost.json"].concat(node.arguments), + @["node"].concat(node.arguments), options = poptions, stdoutHandle = AsyncProcess.Pipe, ) + + await node.waitUntilStarted() + + var execResult = await execCommandEx( + "cd " & node.workingDir() & " && " & node.workingDir() / node.executable() & + " run " & node.workingDir() / "scripts" / "mine.js --network localhost" + ) + + assert execResult.status == 0 + + execResult = await execCommandEx( + "cd " & node.workingDir() & " && " & node.workingDir() / node.executable() & + " ignition deploy ignition/modules/marketplace.js --network localhost" + ) + + assert execResult.status == 0 + + trace "hardhat post start scripts executed" except CancelledError as error: raise error except CatchableError as e: diff --git a/tests/integration/multinodes.nim b/tests/integration/multinodes.nim index a95fde58..42fff157 100644 --- a/tests/integration/multinodes.nim +++ b/tests/integration/multinodes.nim @@ -139,14 +139,12 @@ template multinodesuite*(name: string, body: untyped) = let updatedLogFile = getLogFile(role, none int) args.add "--log-file=" & updatedLogFile - let node = await HardhatProcess.startNode(args, config.debugEnabled, "hardhat") try: - await node.waitUntilStarted() + let node = await HardhatProcess.startNode(args, config.debugEnabled, "hardhat") + trace "hardhat node started" + return node except NodeProcessError as e: - raiseMultiNodeSuiteError "hardhat node not started: " & e.msg - - trace "hardhat node started" - return node + raiseMultiNodeSuiteError "cannot start hardhat process: " & e.msg proc newCodexProcess( roleIdx: int, conf: CodexConfig, role: Role diff --git a/vendor/codex-contracts-eth b/vendor/codex-contracts-eth index 2dddc260..dee3d7b6 160000 --- a/vendor/codex-contracts-eth +++ b/vendor/codex-contracts-eth @@ -1 +1 @@ -Subproject commit 2dddc260152b6e9c24ae372397f9b9b2d27ce8e4 +Subproject commit dee3d7b654de02db2e8a023e37120b51150ff6cb