Run integration tests against multiple Bitcoin Core versions#600
Run integration tests against multiple Bitcoin Core versions#600Sjors wants to merge 11 commits into
Conversation
a079c4c to
4eee53d
Compare
Update the existing integration workflow to actions/checkout@v6 and macos-15. Behavior changes: - Existing integration tests run on macos-15 instead of macos-latest.
Move BitcoinCoreIpc-only integration tests into bitcoin_core_ipc_integration. Behavior changes: - Test names and assertions stay the same.
Move test_create_mempool_transaction into template_provider_integration. Behavior changes: - The test name and assertions stay the same.
Compile integration-test binaries once per OS and run tests from the archived build. Behavior changes: - The new build job uploads a nextest archive per OS and does not run tests. - Test jobs download that archive instead of recompiling.
Select Bitcoin Core release tests from BITCOIN_CORE_VERSION instead of always using the latest release. Behavior changes: - v30.x and v31.x choose their matching IPC ABI and release tarball. - Version-specific IPC tests skip when another Core version is selected.
Allow BITCOIN_CORE_VERSION values like bitcoin/bitcoin@master to use BITCOIN_CORE_BINARY instead of a release tarball. Behavior changes: - Source entries skip release downloads. - BITCOIN_CORE_IPC_VERSION can override the IPC ABI; otherwise source entries use the latest supported ABI.
Add bitcoin-capnp-types master and a unix_capnp::master wrapper using shared v31x sources. Behavior changes: - Master IPC bindings are available but not selected yet.
Add a per-OS job that builds bitcoin/bitcoin@master and uploads bitcoin-node. Behavior changes: - Source-built Core binaries are produced once per OS for test jobs. - Source builds restore and save a per-OS ccache cache. - Bitcoin Core C/C++ compilation uses ccache.
Run the integration test job against bitcoin/bitcoin@master using the source-built bitcoin-node artifact, driven through a shared setup-bitcoin-integration-test action. Behavior changes: - BITCOIN_CORE_VERSION=bitcoin/bitcoin@master selects the Master IPC adapter. - The test archive build updates bitcoin-capnp-types master before compiling.
Add v30.2 and v31.0 release legs beside bitcoin/bitcoin@master. Behavior changes: - CI covers v30.2, v31.0, and master on each OS. - Standalone sv2-tp uses v1.0.6 for v30.x and v1.1.0 for v31.x/master.
Split archived integration tests into node-free, BitcoinCoreIpc, and standalone sv2-tp jobs. Behavior changes: - Node-free tests run once per OS. - BitcoinCoreIpc and standalone sv2-tp tests stay in the Bitcoin Core version matrix. The standalone sv2-tp bucket would run ~77 tests serially (~23 minutes), dwarfing the other jobs, so it is further split into three roughly equal-duration buckets, grouped by role so a failing job points at a subsystem: - ci-sv2-tp-jd: jd_*, jdc_*, jds_* (~6.5 min) - ci-sv2-tp-translator: translator, monitoring (~8.5 min) - ci-sv2-tp-other: pool, sv1, sniffer, ... (~7.5 min) Durations are based on per-test timings from a previous CI run. ci-sv2-tp-other is a catch-all (not one of the other profiles), so new test binaries run there by default without touching the filters.
|
@Sjors thanks for the contribution I agree that the current state of Integration Test CI is far from perfect, and there's lots of room for improvement with that said, I'm afraid this PR is a bit too ambitious, in the sense that it's trying to do things in many different axis, while each different axis deserves careful evaluation I propose we have an initial discussion about them here, and based on the outcomes we can create different issues so they can be addressed/reviewed gradually and confidently improve coverage across different Bitcoin Core versionswith #548, the deliberate policy for coverage across Bitcoin Core versions we established was:
the rationale for this strategy is:
this felt like a reasonable balance between the multiplicative explosion that could come out of (naively) attempting to always execute the entire stack against all versions but I'm sure there's ways to poke holes in this rationale, as it might leave room for regressions against old versions to silently seep in support Bitcoin Core
|
|
@plebhash thanks for the feedback. I think it makes sense to split things off into smaller pull requests, after discussion. Marking this as draft. There's two motivations for tracking Bitcoin Core's master branch:
However I think you're right that it doesn't need to be on the main branch, perhaps a nightly branch would be better for this (with nightly CI runs against the laster bitcoin/bitcoin master branch).
I don't think you can avoid such an explosion, and I think it's better to explictly not support old versions than to half-support them. Also, by having CI run the actual release, it's easy to reproduce a (newly discovered) bug with an old release, open a pull requests with a test and fix combo, and immediately get feedback from CI that it's an end-to-end fix. I also find it easier to reason about code that talks to a real node, but that's perhaps because I'm more familar with the node itself better than the code here :-) Based on my experience with this PR, it seems fine to support several releaeses, maybe tracking Bitcoin Core's end-of-life policy. Maybe a good place to start are the first couple of commits that re-organize the tests a bit more by subsystem? Then wait for #602 and then have v31 and v30 run against a real node in CI, not including master? |
The current integration tests are slow and only exercise the latest node release. This runs them against Bitcoin Core v30.2, v31.0, and master (on Ubuntu and macOS).
How the work is divided
cargo nextest archive); every test job runs from that archive instead of recompiling.bitcoin/bitcoin@masteris source-built once per OS and cached with ccache.Version handling
unix_capnp/master, which reuses the v31 backend via path imports — no file copying, since master doesn't yet diverge from v31.Caveat: master tracks
bitcoin-capnp-typesthrough a gitbranch = "master"dependency and acargo updatestep in CI, so - like Bitcoin Core - it changes as upstream moves.Testing a feature branch instead of master is a one-line change to the matrix entry (e.g.
youruser/bitcoin@your-branch).CI Summary tab preview:
Maintainer note
This replaces two big integration tests with many small ones, which impacts the branch protection rule for required CI jobs.