-
Notifications
You must be signed in to change notification settings - Fork 995
Add test summary reporting to block-test command #9246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
4383107 to
4796a1c
Compare
ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/BlockchainTestSubCommand.java
Outdated
Show resolved
Hide resolved
ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/BlockchainTestSubCommand.java
Show resolved
Hide resolved
ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/BlockchainTestSubCommand.java
Outdated
Show resolved
Hide resolved
a680c29 to
2cf63aa
Compare
ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/BlockchainTestSubCommand.java
Outdated
Show resolved
Hide resolved
ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/BlockchainTestSubCommand.java
Outdated
Show resolved
Hide resolved
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
|
Thank you for your feedback, sorry for the incomplete changes in my previous push, hope the latest version is better :) |
usmansaleem
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
siladu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
macfarla
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The mgas/s is already displayed with block-test for each imported block. It was added here : #9147. |
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 (hyperledger#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>
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 (hyperledger#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>
* 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>
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