-
Notifications
You must be signed in to change notification settings - Fork 14
Add ref-url for fetching test data #113
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
Caution Review failedThe pull request is closed. WalkthroughA new Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant Main
participant Event
participant LocustOptions
User->>CLI: Run with --ref-url (optional)
CLI->>Main: Parse --ref-url and other options
Main->>LocustOptions: Pass ref_url to LocustOptions
Main->>Event: Start test with options (including ref_url)
Event->>Event: On init, resolve ref_url or fallback to target URL
Event->>BlockchainNode: Fetch test data from ref_url/target URL
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
Note 🔌 MCP (Model Context Protocol) integration is now available in Early Access!Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context. 📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
chainbench/util/cli.py (1)
207-210
: Minor formatting issue with extra blank line.The logic for appending the
--ref-url
argument is correct. However, there's an extra blank line at Line 207 that should be removed to maintain consistent code formatting.Apply this diff to fix the formatting:
if self.batch_size is not None: command += f" --batch-size {self.batch_size}" - if self.ref_url is not None: command += f" --ref-url {self.ref_url}" return command
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
README.md
(1 hunks)chainbench/main.py
(4 hunks)chainbench/util/cli.py
(2 hunks)chainbench/util/event.py
(3 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
chainbench/util/event.py (3)
chainbench/test_data/ethereum.py (1)
init_http_client
(101-103)chainbench/test_data/blockchain.py (1)
init_http_client
(128-130)chainbench/test_data/evm.py (4)
EvmTestData
(435-521)fetch_chain_id
(459-460)init_network
(440-441)network
(444-447)
🪛 GitHub Actions: Checks
chainbench/util/event.py
[error] 1-1: Black formatting check failed. File would be reformatted. Run 'black' to fix code style issues.
chainbench/main.py
[error] 1-1: Black formatting check failed. File would be reformatted. Run 'black' to fix code style issues.
🔇 Additional comments (9)
chainbench/util/cli.py (1)
147-147
: LGTM!The
ref_url
attribute is properly added to theLocustOptions
dataclass with appropriate typing.README.md (1)
130-130
: LGTM!The documentation for the new
--ref-url
flag is clear, concise, and follows the established format of other parameter descriptions.chainbench/util/event.py (3)
34-34
: LGTM!Adding the trailing period improves consistency in the help text formatting.
51-53
: LGTM!The help text improvements and inclusion in web UI are appropriate updates.
54-60
: LGTM!The
--ref-url
argument is properly configured with appropriate type, default value, help text, and web UI inclusion.chainbench/main.py (4)
213-213
: LGTM!The
--ref-url
click option is properly configured with appropriate help text that matches the functionality.
247-247
: LGTM!The function signature is correctly updated to include the
ref_url
parameter with proper typing.
384-384
: LGTM!The
ref_url
parameter is correctly passed to theLocustOptions
constructor, completing the integration of the new functionality.
285-285
: Confirmed two-value return signature for load_locustfile
load_locustfile
returns exactly two items—user_classes
andshape_classes
—so unpacking into two variables (and discarding the second with_
) is correct. No further changes needed.
Description
Summary by CodeRabbit
New Features
--ref-url
command-line option to specify a reference blockchain node URL for fetching test data before benchmarks begin. If not provided, the target URL is used by default.Documentation
--ref-url
flag and its usage.Style
Chores
solders
dependency version from^0.22.0
to^0.26.0
.black
,mypy
,flake8
, andisort
.