clarinet icon indicating copy to clipboard operation
clarinet copied to clipboard

Make stacks-devnet-js compatible with CI

Open playerx opened this issue 4 years ago • 3 comments

Hi,

I'm trying to run devnet (using stacks-devnet-js) for integration tests using Github actions. It works correctly on Intel based MacBook but it fails on CI

Error message:

LogData { occurred_at: "Jan  7 08:53:28.448821", message: "Creating network stackProj.devnet", level: Info }
LogData { occurred_at: "Jan  7 08:53:28.703628", message: "Starting bitcoind", level: Info }
LogData { occurred_at: "Jan  7 08:53:33.010864", message: "Starting stacks-node", level: Info }
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: JsonRpc(Transport(SocketError(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" })))', src/indexer/chains/bitcoin.rs:39:44

Detailed logs: https://github.com/playerx/stx-smart-contract/runs/4736889793?check_suite_focus=true#step:5:18

I didn't find any example on this repo or on GitHub of using stacks-devnet-js with Github Actions. I just found clarinet test which supports only pseudo-integration tests.

playerx avatar Jan 07 '22 09:01 playerx

As I guess stacks-node can't connect to the bitcoind instance 🤔

playerx avatar Jan 07 '22 10:01 playerx

I've checked the source code and localhost is used in the url: https://github.com/hirosystems/clarinet/blob/b48124d977ff944c6fc7469567a07466d2c3ff5f/src/integrate/events_observer.rs#L131-L136

Can it be the problem? sometimes it needs to be 127.0.0.1 it would be great to have bitcoin_node_rpc_url parameter configurable as well next to bitcoin_node_username and bitcoin_node_password

playerx avatar Jan 07 '22 10:01 playerx

Hey @playerx! You're right, I don't think you can run a stacks-devnet-js based test via Github actions with the current version, it would require a few tweaks, like the one you mentioned. Adding this to our backlog, but providing an ETA is going to be challenging.

lgalabru avatar Jan 07 '22 14:01 lgalabru

Closing this due to lack of activity. Thank you for filing it! We welcome contributions here if still applicable.

smcclellan avatar Jul 19 '23 23:07 smcclellan