bitcoindevkit / bitcoindevkit/bdk-dart
feat(ci): migrate integration tests to use a local Regtest environment
- Dominant language
- Dart
- Stars
- 13
- Forks
- 20
- Avg merge
- 24m
- Merged PRs (30d)
- 3
Description
### Summary
Integration tests in `test/integration/` currently rely on public Blockstream testnet servers. This introduces external network dependencies into the CI pipeline, making automated test runs vulnerable to rate limits and third-party downtime.
### Problem Description
Currently, `just demo-test` and the GitHub Action integration workflows hit `electrum.blockstream.info` and `blockstream.info/testnet/api`.
As a result:
- CI builds randomly fail when public endpoints rate-limit the GitHub runners or experience outages.
- PRs often display false-negative test failures that require manual re-runs by maintainers.
- Test execution is significantly slower due to remote network latency.
### Why this matters
Relying on public infrastructure for automated CI runs is an anti-pattern for a robust library. When contributors push code, they need deterministic, fast feedback. CI should only fail if the code itself is actually broken, not because an external API rejected the connection.
### Relevant code
- `.github/workflows/ci.yml` defines the testing jobs and environment.
- `README.md` documents the `BDK_DART_ELECTRUM_URL` and `BDK_DART_ESPLORA_URL` environment variables pointing to public servers.
- The `test/integration/` directory contains the test harness relying on these variables.
### Suggested direction
Migrate the CI integration tests to use a local, deterministic Regtest environment (e.g., spinning up a local `bitcoind` + Electrs/Esplora instance via Docker/Nigiri in GitHub Actions).
Specifically, we should:
1. Add a setup step in the CI workflow to spin up the local regtest node and fund a test wallet.
2. Override the CI environment variables to point to the `localhost` regtest ports.
3. Execute `dart test test/integration` against the local node.
can i go ahead and open a PR on this @Johnosezele
Contributor guide
Research direction
Start with .github/workflows/ci.yml, README.md, and the test/integration/ harness to trace the current public endpoints and environment variables. Review the proposed local bitcoind plus Electrs/Esplora setup, then run dart test test/integration against the local regtest environment. Done means CI uses localhost ports, funds a test wallet, and no longer depends on the public Blockstream services.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, docker, github-actions
- Domain
- ci-cd, devops, testing-qa
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100