feat(gltest): add testnet_bradbury to preconfigured networks#74
feat(gltest): add testnet_bradbury to preconfigured networks#74MuncleUscles merged 2 commits intomainfrom
Conversation
Register GenLayer Bradbury testnet as a preconfigured network so `gltest --network testnet_bradbury` (or `--chain-type testnet_bradbury`) routes against https://rpc-bradbury.genlayer.com via the chain definition shipped in genlayer-py. - constants.py: add `testnet_bradbury` to PRECONFIGURED_NETWORKS + CHAINS - user.py: import `testnet_bradbury`, add default network entry (no accounts by default, same pattern as testnet_asimov) - types.py: add to chain_map in GeneralConfig.get_chain() - pyproject.toml: bump genlayer-py pin from 0.9.0 to >=0.11.0 (first version that exports testnet_bradbury) - test_plugin.py: update help-output and chain-type assertions
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 53 minutes and 29 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR adds support for a new preconfigured network called Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
pyproject.toml (1)
17-17: Consider an upper bound ongenlayer-py.Switching from an exact pin to
>=0.11.0with no upper bound means future major/minor releases ofgenlayer-pywill be auto-accepted and could break gltest (e.g., iftestnet_bradburyorrpc_urlsshape changes). Consider>=0.11.0,<0.12.0(or whatever the next expected-compatible boundary is) to keep installs reproducible until explicitly bumped.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@pyproject.toml` at line 17, The dependency line for genlayer-py currently allows any future release ("genlayer-py>=0.11.0"); tighten it to a bounded range to avoid automatic upgrades breaking gltest by changing APIs (e.g., testnet_bradbury or rpc_urls). Update the dependency spec in pyproject.toml from "genlayer-py>=0.11.0" to a caret or range pin such as "genlayer-py>=0.11.0,<0.12.0" (or the appropriate next incompatible version) so installs remain reproducible until you intentionally bump the version.tests/gltest_cli/config/test_plugin.py (1)
113-129: Add a paralleltest_network_testnet_bradburytest.
test_network_testnetasserts that running with--network=testnet_asimovand no accounts exits non-zero. Sincetestnet_bradburyhas the sameaccounts=Nonedefault, consider adding an analogous test to lock in that behavior — especially if you adopt the suggested parity guard inplugin.py. Otherwise a regression that silently letstestnet_bradburyrun with no accounts would go unnoticed.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/gltest_cli/config/test_plugin.py` around lines 113 - 129, Add a parallel test to ensure the same "no accounts => non-zero exit" behavior for the bradbury testnet: create a new test function named test_network_testnet_bradbury that mirrors test_network_testnet (uses pytester.makepyfile with from gltest_cli.config.general import get_general_config and asserts get_general_config().get_network_name() == "testnet_bradbury"), run pytester.runpytest with "--network=testnet_bradbury" and "--rpc-url=http://test.example.com:9151" and assert result.ret != 0 so regressions in plugin.py parity checks for testnet_bradbury are caught.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@gltest_cli/config/user.py`:
- Around line 74-83: Update the guard in plugin.py that checks network_name so
it rejects both testnet_asimov and testnet_bradbury when no accounts are
configured: modify the conditional that currently only checks "testnet_asimov"
to check membership in ("testnet_asimov", "testnet_bradbury") and keep the
existing logger.error and pytest.exit calls (refer to network_name,
logger.error, pytest.exit in plugin.py) so running gltest --network
testnet_bradbury fails fast with the same helpful message.
---
Nitpick comments:
In `@pyproject.toml`:
- Line 17: The dependency line for genlayer-py currently allows any future
release ("genlayer-py>=0.11.0"); tighten it to a bounded range to avoid
automatic upgrades breaking gltest by changing APIs (e.g., testnet_bradbury or
rpc_urls). Update the dependency spec in pyproject.toml from
"genlayer-py>=0.11.0" to a caret or range pin such as
"genlayer-py>=0.11.0,<0.12.0" (or the appropriate next incompatible version) so
installs remain reproducible until you intentionally bump the version.
In `@tests/gltest_cli/config/test_plugin.py`:
- Around line 113-129: Add a parallel test to ensure the same "no accounts =>
non-zero exit" behavior for the bradbury testnet: create a new test function
named test_network_testnet_bradbury that mirrors test_network_testnet (uses
pytester.makepyfile with from gltest_cli.config.general import
get_general_config and asserts get_general_config().get_network_name() ==
"testnet_bradbury"), run pytester.runpytest with "--network=testnet_bradbury"
and "--rpc-url=http://test.example.com:9151" and assert result.ret != 0 so
regressions in plugin.py parity checks for testnet_bradbury are caught.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 54168776-a348-46a3-993f-6e2f65f82b09
📒 Files selected for processing (5)
gltest_cli/config/constants.pygltest_cli/config/types.pygltest_cli/config/user.pypyproject.tomltests/gltest_cli/config/test_plugin.py
- plugin.py: accounts-required guard now covers both testnet_asimov and testnet_bradbury (parity fix — bradbury was silently falling through with no accounts configured) - pyproject.toml: cap genlayer-py to <0.12.0 so transitive upgrades don't silently break gltest - test_plugin.py: add test_network_testnet_bradbury mirroring the existing asimov guard test
Summary
https://rpc-bradbury.genlayer.com, chain id 4221) as a preconfigured gltest network, same waytestnet_asimovis today.gltest --network testnet_bradburyand--chain-type testnet_bradburynow route against the live Bradbury RPC via the chain definition that's already shipped ingenlayer-py0.11.0+.genlayer-pypin from==0.9.0to>=0.11.0(the first version that exportstestnet_bradbury).Why
Downstream projects (Rally) want to run real, non-mocked IC integration tests against Bradbury. Today gltest only knows about
localnet/studionet/testnet_asimov, so Bradbury needs manualgltest.config.yamlscaffolding for every repo. Adding it toPRECONFIGURED_NETWORKSmakes it a one-flag flip.Changes
gltest_cli/config/constants.py: appendtestnet_bradburytoPRECONFIGURED_NETWORKSandCHAINS.gltest_cli/config/user.py: importtestnet_bradburyand add the default network entry (no accounts by default, same as asimov — callers supply their own keys).gltest_cli/config/types.py: addtestnet_bradburytoGeneralConfig.get_chain()'schain_map.pyproject.toml:genlayer-py==0.9.0→genlayer-py>=0.11.0.tests/gltest_cli/config/test_plugin.py: update help-output assertion and thechain_type in [...]allowed-values list.Note: Bradbury and Asimov both report chain id
4221ingenlayer-py— this is intentional per the upstream chain definitions, not a bug.Test plan
pytest tests/gltest_cli/config/ -q— 67/67 passing locallyGeneralConfigwithdefault_network='testnet_bradbury'resolves to the real chain object (id 4221, rpchttps://rpc-bradbury.genlayer.com)gltest --network testnet_bradburyhits live Bradbury RPCSummary by CodeRabbit
Release Notes
New Features
testnet_bradburynetwork, expanding available test network options for configuration and testing.Chores
genlayer-pydependency requirement to version 0.11.0 or later for enhanced compatibility.