Skip to content

test(cli): add config file precedence integration tests#488

Open
kariy wants to merge 3 commits intomainfrom
refactor/cli
Open

test(cli): add config file precedence integration tests#488
kariy wants to merge 3 commits intomainfrom
refactor/cli

Conversation

@kariy
Copy link
Copy Markdown
Member

@kariy kariy commented Mar 17, 2026

Summary

  • Improve --config arg help message to clarify file vs CLI precedence
  • Add 9 integration tests in crates/cli/tests/config_file.rs covering the SequencerNodeArgs::with_config_file() merge logic:
    • File-only values across all option groups (sequencing, execution, dev, gpo)
    • CLI args taking precedence over file values
    • Partial config files with serde defaults for unset fields
    • no_mining bool merge in both directions
    • DbOptions field-level merge (CLI dir override, file migrate preserved)
    • DevOptions field-level merge (CLI seed/accounts, file no_fee/no_account_validation)
    • Empty config file edge case
    • Hex gas price parsing (0xff, 0x10) via custom deserializer

Test plan

  • cargo nextest run -p katana-cli --test config_file — all 9 tests pass
  • Tests verified stable across multiple consecutive runs

🤖 Generated with Claude Code

kariy and others added 2 commits March 16, 2026 23:35
Clarify that the config file is an alternative to CLI arguments for
node configuration, and that CLI args take precedence when both are
provided.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Add integration tests for the config file merge/precedence logic in
SequencerNodeArgs::with_config_file(), covering file-only values,
CLI overrides, partial configs, dev/db option merging, and hex parsing.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Details
Benchmark suite Current: 11f77b4 Previous: 6bc4997 Ratio
CompiledClass(fixture)/compress 2682718 ns/iter (± 58792) 2750262 ns/iter (± 7746) 0.98
CompiledClass(fixture)/decompress 2926642 ns/iter (± 14198) 2933827 ns/iter (± 91332) 1.00
ExecutionCheckpoint/compress 34 ns/iter (± 9) 34 ns/iter (± 10) 1
ExecutionCheckpoint/decompress 25 ns/iter (± 8) 25 ns/iter (± 5) 1
PruningCheckpoint/compress 34 ns/iter (± 9) 34 ns/iter (± 11) 1
PruningCheckpoint/decompress 26 ns/iter (± 10) 26 ns/iter (± 5) 1
VersionedHeader/compress 637 ns/iter (± 16) 620 ns/iter (± 7) 1.03
VersionedHeader/decompress 821 ns/iter (± 15) 820 ns/iter (± 11) 1.00
StoredBlockBodyIndices/compress 77 ns/iter (± 5) 77 ns/iter (± 6) 1
StoredBlockBodyIndices/decompress 35 ns/iter (± 8) 36 ns/iter (± 7) 0.97
StorageEntry/compress 153 ns/iter (± 2) 144 ns/iter (± 1) 1.06
StorageEntry/decompress 139 ns/iter (± 3) 137 ns/iter (± 3) 1.01
ContractNonceChange/compress 147 ns/iter (± 2) 144 ns/iter (± 2) 1.02
ContractNonceChange/decompress 239 ns/iter (± 3) 244 ns/iter (± 5) 0.98
ContractClassChange/compress 216 ns/iter (± 2) 203 ns/iter (± 5) 1.06
ContractClassChange/decompress 257 ns/iter (± 3) 258 ns/iter (± 12) 1.00
ContractStorageEntry/compress 158 ns/iter (± 3) 153 ns/iter (± 4) 1.03
ContractStorageEntry/decompress 310 ns/iter (± 3) 308 ns/iter (± 12) 1.01
GenericContractInfo/compress 128 ns/iter (± 2) 130 ns/iter (± 6) 0.98
GenericContractInfo/decompress 105 ns/iter (± 3) 103 ns/iter (± 2) 1.02
Felt/compress 83 ns/iter (± 9) 82 ns/iter (± 10) 1.01
Felt/decompress 56 ns/iter (± 7) 60 ns/iter (± 12) 0.93
BlockHash/compress 81 ns/iter (± 6) 82 ns/iter (± 9) 0.99
BlockHash/decompress 56 ns/iter (± 6) 58 ns/iter (± 14) 0.97
TxHash/compress 81 ns/iter (± 2) 81 ns/iter (± 6) 1
TxHash/decompress 56 ns/iter (± 4) 58 ns/iter (± 9) 0.97
ClassHash/compress 81 ns/iter (± 4) 82 ns/iter (± 8) 0.99
ClassHash/decompress 56 ns/iter (± 4) 58 ns/iter (± 10) 0.97
CompiledClassHash/compress 82 ns/iter (± 5) 81 ns/iter (± 8) 1.01
CompiledClassHash/decompress 56 ns/iter (± 5) 58 ns/iter (± 7) 0.97
BlockNumber/compress 47 ns/iter (± 2) 47 ns/iter (± 3) 1
BlockNumber/decompress 25 ns/iter (± 0) 26 ns/iter (± 1) 0.96
TxNumber/compress 47 ns/iter (± 3) 47 ns/iter (± 2) 1
TxNumber/decompress 25 ns/iter (± 1) 26 ns/iter (± 2) 0.96
FinalityStatus/compress 1 ns/iter (± 0) 1 ns/iter (± 0) 1
FinalityStatus/decompress 12 ns/iter (± 0) 12 ns/iter (± 0) 1
TypedTransactionExecutionInfo/compress 15948 ns/iter (± 118) 17805 ns/iter (± 68) 0.90
TypedTransactionExecutionInfo/decompress 3581 ns/iter (± 94) 3570 ns/iter (± 83) 1.00
VersionedContractClass/compress 388 ns/iter (± 5) 373 ns/iter (± 4) 1.04
VersionedContractClass/decompress 789 ns/iter (± 6) 783 ns/iter (± 5) 1.01
MigratedCompiledClassHash/compress 148 ns/iter (± 8) 146 ns/iter (± 7) 1.01
MigratedCompiledClassHash/decompress 140 ns/iter (± 5) 142 ns/iter (± 6) 0.99
ContractInfoChangeList/compress 1751 ns/iter (± 26) 1715 ns/iter (± 32) 1.02
ContractInfoChangeList/decompress 2081 ns/iter (± 380) 2112 ns/iter (± 378) 0.99
BlockChangeList/compress 858 ns/iter (± 67) 728 ns/iter (± 17) 1.18
BlockChangeList/decompress 847 ns/iter (± 152) 840 ns/iter (± 160) 1.01
ReceiptEnvelope/compress 33295 ns/iter (± 1549) 30455 ns/iter (± 432) 1.09
ReceiptEnvelope/decompress 6069 ns/iter (± 449) 5989 ns/iter (± 316) 1.01
TrieDatabaseValue/compress 164 ns/iter (± 3) 164 ns/iter (± 2) 1
TrieDatabaseValue/decompress 246 ns/iter (± 1) 251 ns/iter (± 3) 0.98
TrieHistoryEntry/compress 296 ns/iter (± 5) 295 ns/iter (± 4) 1.00
TrieHistoryEntry/decompress 278 ns/iter (± 9) 271 ns/iter (± 10) 1.03

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 17, 2026

Runner: AMD EPYC 7763 64-Core Processor (4 cores) · 15Gi RAM

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.49%. Comparing base (9bde0ae) to head (11f77b4).
⚠️ Report is 309 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #488      +/-   ##
==========================================
- Coverage   73.32%   69.49%   -3.83%     
==========================================
  Files         209      287      +78     
  Lines       23132    35193   +12061     
==========================================
+ Hits        16961    24458    +7497     
- Misses       6171    10735    +4564     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant