Skip to content

tests: improve clarity vm tests#7257

Open
federico-stacks wants to merge 7 commits into
stacks-network:developfrom
federico-stacks:test/improve-vm-tests
Open

tests: improve clarity vm tests#7257
federico-stacks wants to merge 7 commits into
stacks-network:developfrom
federico-stacks:test/improve-vm-tests

Conversation

@federico-stacks

@federico-stacks federico-stacks commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Description

Tidy-up and correctness pass over the Clarity VM unit tests (costs.rs, analysis_costs.rs, large_contract.rs, transactions.rs) and the shared test instantiation helpers. The main functional fix addresses a latent mismatch where a test's BurnStateDB epoch and the cost contracts actually deployed in the ClarityDatabase could disagree the tests still passed, but exercised the wrong costs-N contract for the epoch under test.

This issue emerged during PR #6959 where caching for ClarityDatabase epoch was introduced, making the now "fixed" tests failing.

Applicable issues

  • fixes #

Additional info (benefits, drawbacks, caveats)

Checklist

  • Test coverage for new or modified code paths
  • For new Clarity features or consensus changes, add property tests (see docs/property-testing.md)
  • Changelog fragment(s) or "no changelog" label added (see changelog.d/README.md)
  • Required documentation changes (e.g., rpc/openapi.yaml for RPC endpoints, event-dispatcher.md for new events)
  • New clarity functions have corresponding PR in clarity-benchmarking repo

@federico-stacks federico-stacks self-assigned this Jun 1, 2026
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 26746080137

Coverage increased (+0.02%) to 85.727%

Details

  • Coverage increased (+0.02%) from the base build.
  • Patch coverage: 1 uncovered change across 1 file (125 of 126 lines covered, 99.21%).
  • 6703 coverage regressions across 124 files.

Uncovered Changes

File Changed Covered %
stackslib/src/chainstate/stacks/db/mod.rs 59 58 98.31%
Total (2 files) 126 125 99.21%

Coverage Regressions

6703 previously-covered lines in 124 files lost coverage.

Top 10 Files by Coverage Loss Lines Losing Coverage Coverage
stackslib/src/config/mod.rs 376 68.96%
stackslib/src/net/mod.rs 311 77.84%
stackslib/src/chainstate/stacks/index/storage.rs 284 82.27%
stackslib/src/chainstate/stacks/miner.rs 256 83.23%
clarity/src/vm/database/clarity_db.rs 245 82.18%
stackslib/src/chainstate/stacks/db/transactions.rs 222 97.17%
stackslib/src/net/inv/epoch2x.rs 219 79.55%
stackslib/src/net/chat.rs 202 92.95%
stackslib/src/chainstate/stacks/db/mod.rs 196 86.57%
stackslib/src/core/mempool.rs 193 86.44%

Coverage Stats

Coverage Status
Relevant Lines: 223553
Covered Lines: 191645
Line Coverage: 85.73%
Coverage Strength: 18916153.04 hits per line

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants