Add test summary reporting to block-test command#9246
Merged
siladu merged 5 commits intobesu-eth:mainfrom Oct 15, 2025
Merged
Conversation
4383107 to
4796a1c
Compare
usmansaleem
reviewed
Oct 8, 2025
ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/BlockchainTestSubCommand.java
Outdated
Show resolved
Hide resolved
usmansaleem
reviewed
Oct 8, 2025
ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/BlockchainTestSubCommand.java
Show resolved
Hide resolved
usmansaleem
reviewed
Oct 8, 2025
ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/BlockchainTestSubCommand.java
Outdated
Show resolved
Hide resolved
a680c29 to
2cf63aa
Compare
usmansaleem
reviewed
Oct 8, 2025
ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/BlockchainTestSubCommand.java
Outdated
Show resolved
Hide resolved
usmansaleem
reviewed
Oct 8, 2025
ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/BlockchainTestSubCommand.java
Outdated
Show resolved
Hide resolved
usmansaleem
reviewed
Oct 8, 2025
ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/BlockchainTestSubCommand.java
Outdated
Show resolved
Hide resolved
The block-test command now tracks and displays a summary of test execution results, including total tests, passed/failed counts, and a list of failed tests with their failure reasons. This improves usability when running large test suites by providing a clear overview of test outcomes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Bhargava Shastry <bhargava.shastry@ethereum.org>
Address code review feedback by: - Extract separator string into SEPARATOR constant to reduce duplication - Reuse failureReason variable in output statements instead of duplicating formatting logic This improves code maintainability by consolidating the failure message formatting in a single location. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Bhargava Shastry <bhargava.shastry@ethereum.org>
2cf63aa to
4877f10
Compare
- Remove unused testName parameter from recordPass() method - Remove totalTests field and calculate it dynamically in printSummary() from passed + failed counts - Simplify SEPARATOR constant by removing embedded newline and use explicit out.println() for consistent formatting - Add hasTests() helper method to check if any tests were executed This reduces redundant state tracking and improves code clarity. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Bhargava Shastry <bhargava.shastry@ethereum.org>
4877f10 to
f3b6224
Compare
Contributor
Author
|
Thank you for your feedback, sorry for the incomplete changes in my previous push, hope the latest version is better :) |
siladu
approved these changes
Oct 15, 2025
Contributor
siladu
left a comment
There was a problem hiding this comment.
LGTM, nice addition!
Wondering if it would be an improvement to include an average throughput in MGas/s in the summary? That can be a separate PR though.
Contributor
The mgas/s is already displayed with block-test for each imported block. It was added here : #9147. |
bshastry
added a commit
to bshastry/besu
that referenced
this pull request
Oct 15, 2025
Implements tracing functionality for the block-test subcommand in evmtool, allowing developers to debug block test execution with detailed transaction traces including opcodes, gas usage, stack, and memory state. New features: - Added -t/--trace-transactions flag to enable tracing during block test execution - Added --trace-memory, --trace-stack, --trace-returndata, --trace-storage options - Added --trace-output option to specify output file (default: stderr) - Integrated with StandardJsonTracer infrastructure - Traces are output in JSON format compatible with go-ethereum Implementation: The processBlockWithTracing() method processes transactions with full tracing while maintaining correct transaction status handling. Transactions are categorized as INVALID, FAILED, or SUCCESSFUL per Ethereum protocol: - INVALID transactions (wrong nonce, insufficient balance) reject the block - FAILED transactions (reverted execution) are included with receipts - SUCCESSFUL transactions are included with receipts This distinction ensures blocks with reverted transactions are correctly accepted, matching behavior of the standard block import path and reference implementations like go-ethereum. Conflict resolution: This commit was rebased onto main which added test summary reporting (besu-eth#9246). Both features are now merged: - Test summary reporting tracks pass/fail counts across all tests - Transaction tracing provides detailed execution traces when enabled - Both features work independently and complement each other Usage: evmtool block-test -t --trace-stack --trace-memory <test-file.json> evmtool block-test -t --trace-output=trace.jsonl <test-file.json> Tested with Ethereum reference test suite including complex scenarios with failed transactions. Trace output format matches go-ethereum for compatibility with existing tooling. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Bhargava Shastry <bhargava.shastry@ethereum.org>
bshastry
added a commit
to bshastry/besu
that referenced
this pull request
Oct 17, 2025
Implements tracing functionality for the block-test subcommand in evmtool, allowing developers to debug block test execution with detailed transaction traces including opcodes, gas usage, stack, and memory state. New features: - Added -t/--trace-transactions flag to enable tracing during block test execution - Added --trace-memory, --trace-stack, --trace-returndata, --trace-storage options - Added --trace-output option to specify output file (default: stderr) - Integrated with StandardJsonTracer infrastructure - Traces are output in JSON format compatible with go-ethereum Implementation: The processBlockWithTracing() method processes transactions with full tracing while maintaining correct transaction status handling. Transactions are categorized as INVALID, FAILED, or SUCCESSFUL per Ethereum protocol: - INVALID transactions (wrong nonce, insufficient balance) reject the block - FAILED transactions (reverted execution) are included with receipts - SUCCESSFUL transactions are included with receipts This distinction ensures blocks with reverted transactions are correctly accepted, matching behavior of the standard block import path and reference implementations like go-ethereum. Conflict resolution: This commit was rebased onto main which added test summary reporting (besu-eth#9246). Both features are now merged: - Test summary reporting tracks pass/fail counts across all tests - Transaction tracing provides detailed execution traces when enabled - Both features work independently and complement each other Usage: evmtool block-test -t --trace-stack --trace-memory <test-file.json> evmtool block-test -t --trace-output=trace.jsonl <test-file.json> Tested with Ethereum reference test suite including complex scenarios with failed transactions. Trace output format matches go-ethereum for compatibility with existing tooling. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Bhargava Shastry <bhargava.shastry@ethereum.org>
pinges
pushed a commit
to pinges/besu
that referenced
this pull request
Dec 15, 2025
* Add test summary reporting to block-test command The block-test command now tracks and displays a summary of test execution results, including total tests, passed/failed counts, and a list of failed tests with their failure reasons. This improves usability when running large test suites by providing a clear overview of test outcomes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Bhargava Shastry <bhargava.shastry@ethereum.org> * Refactor block-test summary output for better maintainability Address code review feedback by: - Extract separator string into SEPARATOR constant to reduce duplication - Reuse failureReason variable in output statements instead of duplicating formatting logic This improves code maintainability by consolidating the failure message formatting in a single location. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Bhargava Shastry <bhargava.shastry@ethereum.org> * Address review feedback: simplify TestResults implementation - Remove unused testName parameter from recordPass() method - Remove totalTests field and calculate it dynamically in printSummary() from passed + failed counts - Simplify SEPARATOR constant by removing embedded newline and use explicit out.println() for consistent formatting - Add hasTests() helper method to check if any tests were executed This reduces redundant state tracking and improves code clarity. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Bhargava Shastry <bhargava.shastry@ethereum.org> --------- Signed-off-by: Bhargava Shastry <bhargava.shastry@ethereum.org> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Usman Saleem <usman@usmans.info> Co-authored-by: Simon Dudley <simon.dudley@consensys.net> Signed-off-by: stefan.pingel@consensys.net <stefan.pingel@consensys.net>
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.
PR description
This PR adds test summary reporting to the
block-testcommand in evmtool. When processing large test suites (e.g., 1M block tests in a single JSON file), the command now tracks and displays a comprehensive summary at the end of execution, including:This enhancement significantly improves usability when running large blockchain test suites by providing a clear overview of test outcomes without requiring manual parsing of verbose output logs.
Example Output
Fixed Issue(s)
N/A - Enhancement request
Thanks for sending a pull request! Have you done the following?
doc-change-requiredlabel to this PR if updates are required.Locally, you can run these tests to catch failures early:
./gradlew spotlessApply./gradlew build./gradlew acceptanceTest./gradlew integrationTest./gradlew ethereum:referenceTests:referenceTests