Add option to generate LCM from tests#5178
Open
sisuresh wants to merge 4 commits intostellar:masterfrom
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an opt-in test runner mode to automatically capture and persist LedgerCloseMeta (LCM) emitted during ledger closes, primarily to support downstream meta consumers and deterministic fixtures.
Changes:
- Introduces
--capture-lcmin the test runner, accumulating LCM duringcloseLedger/closeLedgerOnand writing stream-framed XDR files per leaf Catch2 section/test-case. - Updates
LedgerManagerImpl(tests-only) to retain the most-recentLedgerCloseMeta(with ledger header) for inspection/capture. - Tags a curated set of tests with
[gen-lcm]and fixes several test ledger-close loops to advance fromLCL+1(to align with stricter assertions).
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/transactions/test/SorobanTxTestUtils.cpp | Adds logging include and fixes namespace comment. |
| src/transactions/test/InvokeHostFunctionTests.cpp | Adds [gen-lcm] tags; fixes several loops to close ledgers starting at LCL+1. |
| src/transactions/test/FrozenLedgerKeysTests.cpp | Adds [gen-lcm] tags to selected tests. |
| src/test/TxTests.h | Declares global accumulated-LCM helpers for tests. |
| src/test/TxTests.cpp | Implements accumulated-LCM storage; captures LCM during ledger closes; adds stricter ledger sequence assertion. |
| src/test/TestUtils.cpp | Appends LCM after Soroban network config upgrades when capture is enabled. |
| src/test/test.h | Declares isLcmCaptureEnabled() for test helpers to query capture mode. |
| src/test/test.cpp | Implements --capture-lcm, per-section capture bookkeeping, and file output under test-lcm/. |
| src/ledger/LedgerManagerImpl.cpp | Moves/stabilizes tests-only mLastLedgerCloseMeta capture and ensures it includes the final ledger header. |
| docs/software/commands.md | Documents --capture-lcm, expected output layout, and [gen-lcm] usage. |
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Resolves #5125
Checklist
clang-formatv8.0.0 (viamake formator the Visual Studio extension)