feat(functional-tests): migrate btcio tests to new framework (STR-2090)#1451
feat(functional-tests): migrate btcio tests to new framework (STR-2090)#1451
Conversation
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #1451 +/- ##
==========================================
- Coverage 75.44% 66.04% -9.40%
==========================================
Files 806 819 +13
Lines 76648 79186 +2538
==========================================
- Hits 57825 52302 -5523
- Misses 18823 26884 +8061
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 320 files with indirect coverage changes 🚀 New features to boost your workflow:
|
|
Commit: 0a65799 SP1 Execution Results
|
delbonis
left a comment
There was a problem hiding this comment.
Generally we don't want the wait_until_ functions to be called in tests directly unless there's some really specific condition the test is looking for. We want to expose the high level operation through helpers that make it so that we can change the implementation (like if RPCs get reworked) without having to go and update every test. Here especially, a very similar pattern is repeated 5 times, so it makes sense to consolidate it.
|
Agree with @delbonis comments in the |
28ab2c0 to
814c0e2
Compare
|
Just that remaining |
… (STR-2090) Migrate 3 of 6 btcio tests that are portable to the new strata binary: - test_l1_connected: verifies strata sees L1 blocks (replaces btcio_connect) - test_l1_tracking: mines blocks and checks strata picks them up (replaces btcio_read) - test_l1_reorg: invalidates blocks and checks strata handles reorg (replaces btcio_read_reorg) All tests use strata_getL1HeaderCommitment as the replacement for the removed strata_l1connected/strata_l1status/strata_getL1blockHash RPCs. Not ported (RPCs removed from new binary): - btcio_broadcast (strataadmin_broadcastRawTx) - btcio_inscriber (strataadmin_submitDABlob) - btcio_resubmit_checkpoint (prover infrastructure)
- Increase wait_until_with_value timeouts from 30s to 60s in test_l1_tracking and test_l1_reorg — strata needs more time in CI to process L1 blocks, especially with 110 pre-generated blocks - Run ruff format on both files to fix lint failures
Move inline wait_until_with_value calls for L1 header commitments into a dedicated StrataService.wait_for_l1_commitment() method, consistent with existing wait_for_block_height/wait_for_block patterns.
814c0e2 to
a6ad430
Compare
- SIM103: simplify conditional return in wait_for_l1_commitment - Format legacy testenv.py
bewakes
left a comment
There was a problem hiding this comment.
Minor nits. Feel free to resolve them and proceed with merging after the failing functional tests are fixed.
- test_l1_reorg: mine blocks above genesis before reorg (was checking heights below genesis where ASM never creates manifests) - test_l1_tracking: use standalone env to avoid sequencer restart interference, increase timeouts - Disable both tests: there is a race in the ASM worker where the L1 reader notifies the ASM about a new block before the full block data is persisted. The ASM fails with "missing l1 block" and the notification is consumed without retry, permanently losing that block. This affects any test mining L1 blocks while strata is running.
- Rename wait_for_l1_commitment -> wait_for_l1_commitment_at (bewakes nit) - Replace last direct strata_getL1HeaderCommitment call in test_l1_tracking with the wait_for_l1_commitment_at helper (delbonis) - Clarify disabled_tests comment: explain test_l1_connected is unaffected, add TODO to re-enable once ASM retry logic is fixed
The L1 reader notifies the ASM worker as soon as it stores the height→blockid mapping, but the block may not yet be fetchable (DB propagation lag, Bitcoin RPC timeout under load). Previously this caused the ASM worker to exit permanently, consuming the notification without retry. Add get_l1_block_with_retry() with exponential backoff (200ms base, 1.5× growth, 2s cap, 10 retries ≈ 10s total). Only MissingL1Block is retried; all other errors propagate immediately. Re-enable test_l1_tracking and test_l1_reorg which were blocked on this race condition.
abadd33 to
0ced17d
Compare
The btcio tests (added by PR #1451) were added to main after the rename commit was written. The rebase didn't capture them, leaving orphaned tracked files under functional-tests-new/tests/btcio/.
* chore: delete legacy functional-tests directory (STR-2085) Remove the entire functional-tests/ directory. All valuable tests have been migrated to functional-tests-new/ or their invariants tracked in JIRA/Notion. Sync tests: added test_sync_genesis to functional-tests-new. Fullnode lag restart test deferred — fullnode sync not yet implemented in new strata binary (tracked in STR-2091). Also: - Fix bug in strata_seq_fullnode.py: pass genesis_l1.blk.height (int) not GenesisL1View object to create_node() - Delete .github/workflows/functional.yml (legacy test workflow) - Update test-coverage.yml, main-eest.yml, dependabot.yml, CODEOWNERS - Update AGENTS.md, README.md, CONTRIBUTING.md references * chore: rename functional-tests-new/ to functional-tests/ (STR-2085) Now that the legacy functional-tests/ directory is deleted, drop the -new suffix. Updates all references across CI workflows, justfile, CODEOWNERS, Dockerfile, docs, and .dockerignore. * chore: exclude functional-tests/_dd from taplo formatting Test run data directory contains generated TOML files that should not be linted. * chore: clean up stray references after functional-tests rename (STR-2085) - CODEOWNERS: drop fn_*.py and constants.py patterns that match nothing in the new layout. - dependabot.yml: restore the uv ecosystem entry for functional-tests/. It was dropped with the legacy delete, but the path is unchanged after the rename so the new framework still needs Python dependency updates. - functional.yml: filter the coverage-instrumented cargo build to the binaries the new tests actually use, and update the which assertion from strata-client to strata. - FUNCTIONAL_TEST_MIGRATION_STATUS.md: delete the migration tracking doc now that the legacy tree is gone. * fix: move btcio tests missed during functional-tests rename (STR-2085) The btcio tests (added by PR #1451) were added to main after the rename commit was written. The rebase didn't capture them, leaving orphaned tracked files under functional-tests-new/tests/btcio/. --------- Co-authored-by: Jose Storopoli <jose@storopoli.com>
Summary
functional-tests-newframeworkstrata_getL1HeaderCommitmentas the replacement for removed L1 RPCs (strata_l1connected,strata_l1status,strata_getL1blockHash)Migrated tests
test_l1_connectedbtcio_connecttest_l1_trackingbtcio_readtest_l1_reorgbtcio_read_reorgNot ported (RPCs removed from new binary)
btcio_broadcaststrataadmin_broadcastRawTxbtcio_inscriberstrataadmin_submitDABlobbtcio_resubmit_checkpointTest plan
cd functional-tests-new && uv run python entry.py -g btcioto verify all 3 tests pass