Skip to content

feat(gltest): add testnet_bradbury to preconfigured networks#74

Merged
MuncleUscles merged 2 commits intomainfrom
feat/add-testnet-bradbury
Apr 20, 2026
Merged

feat(gltest): add testnet_bradbury to preconfigured networks#74
MuncleUscles merged 2 commits intomainfrom
feat/add-testnet-bradbury

Conversation

@MuncleUscles
Copy link
Copy Markdown
Member

@MuncleUscles MuncleUscles commented Apr 20, 2026

Summary

  • Register GenLayer Bradbury testnet (https://rpc-bradbury.genlayer.com, chain id 4221) as a preconfigured gltest network, same way testnet_asimov is today.
  • gltest --network testnet_bradbury and --chain-type testnet_bradbury now route against the live Bradbury RPC via the chain definition that's already shipped in genlayer-py 0.11.0+.
  • Bumps the genlayer-py pin from ==0.9.0 to >=0.11.0 (the first version that exports testnet_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 manual gltest.config.yaml scaffolding for every repo. Adding it to PRECONFIGURED_NETWORKS makes it a one-flag flip.

Changes

  • gltest_cli/config/constants.py: append testnet_bradbury to PRECONFIGURED_NETWORKS and CHAINS.
  • gltest_cli/config/user.py: import testnet_bradbury and add the default network entry (no accounts by default, same as asimov — callers supply their own keys).
  • gltest_cli/config/types.py: add testnet_bradbury to GeneralConfig.get_chain()'s chain_map.
  • pyproject.toml: genlayer-py==0.9.0genlayer-py>=0.11.0.
  • tests/gltest_cli/config/test_plugin.py: update help-output assertion and the chain_type in [...] allowed-values list.

Note: Bradbury and Asimov both report chain id 4221 in genlayer-py — this is intentional per the upstream chain definitions, not a bug.

Test plan

  • pytest tests/gltest_cli/config/ -q — 67/67 passing locally
  • Smoke check: GeneralConfig with default_network='testnet_bradbury' resolves to the real chain object (id 4221, rpc https://rpc-bradbury.genlayer.com)
  • CI green
  • Downstream smoke from Rally: gltest --network testnet_bradbury hits live Bradbury RPC

Summary by CodeRabbit

Release Notes

  • New Features

    • Added support for the testnet_bradbury network, expanding available test network options for configuration and testing.
  • Chores

    • Updated genlayer-py dependency requirement to version 0.11.0 or later for enhanced compatibility.

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
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 20, 2026

Warning

Rate limit exceeded

@MuncleUscles has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 53 minutes and 29 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2d80094c-0683-485d-a3d1-ab219bec9c19

📥 Commits

Reviewing files that changed from the base of the PR and between 0a83e30 and 86ae475.

📒 Files selected for processing (3)
  • gltest_cli/config/plugin.py
  • pyproject.toml
  • tests/gltest_cli/config/test_plugin.py
📝 Walkthrough

Walkthrough

This PR adds support for a new preconfigured network called testnet_bradbury by updating network constants, chain type mappings, default user configurations, and tests. The genlayer-py dependency constraint is also relaxed from exact pinning to a minimum version requirement.

Changes

Cohort / File(s) Summary
Network Constants
gltest_cli/config/constants.py
Added testnet_bradbury to both PRECONFIGURED_NETWORKS and CHAINS constants, expanding supported networks from three to four entries.
Chain Type Mapping
gltest_cli/config/types.py
Imported testnet_bradbury from genlayer_py.chains and added dispatch entry in GeneralConfig.get_chain() to map the "testnet_bradbury" chain type string to its corresponding chain object.
User Configuration
gltest_cli/config/user.py
Added testnet_bradbury to default user network config with RPC URL and settings, and updated validate_network_config to dynamically reference CHAINS instead of a static hardcoded list for missing chain_type error messages.
Dependency Update
pyproject.toml
Relaxed genlayer-py constraint from exact version ==0.9.0 to minimum version >=0.11.0, allowing newer releases while maintaining compatibility floor.
Test Updates
tests/gltest_cli/config/test_plugin.py
Updated CLI help text expectations and test_chain_none_default assertion to include testnet_bradbury as a recognized chain type option.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • PR #52 — Main PR directly extends the same CHAINS/constants and chain-selection dispatch table to add the new testnet network.
  • PR #38 — Main PR extends preconfigured-network infrastructure by adding testnet_bradbury to the same constants, mappings, defaults, and test assertions introduced in this earlier PR.

Suggested reviewers

  • cristiam86

Poem

🐰 A testnet blooms in Bradbury's light,
Four networks strong, a hopeful sight,
Constants aligned, types in place,
New chains now join the network race!
With genlayer-py upgraded true,
The testing suite has work anew. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding testnet_bradbury to preconfigured networks, which is the primary objective of this changeset across all modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/add-testnet-bradbury

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a 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 (2)
pyproject.toml (1)

17-17: Consider an upper bound on genlayer-py.

Switching from an exact pin to >=0.11.0 with no upper bound means future major/minor releases of genlayer-py will be auto-accepted and could break gltest (e.g., if testnet_bradbury or rpc_urls shape 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 parallel test_network_testnet_bradbury test.

test_network_testnet asserts that running with --network=testnet_asimov and no accounts exits non-zero. Since testnet_bradbury has the same accounts=None default, consider adding an analogous test to lock in that behavior — especially if you adopt the suggested parity guard in plugin.py. Otherwise a regression that silently lets testnet_bradbury run 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

📥 Commits

Reviewing files that changed from the base of the PR and between 69fcb7b and 0a83e30.

📒 Files selected for processing (5)
  • gltest_cli/config/constants.py
  • gltest_cli/config/types.py
  • gltest_cli/config/user.py
  • pyproject.toml
  • tests/gltest_cli/config/test_plugin.py

Comment thread gltest_cli/config/user.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
@MuncleUscles MuncleUscles merged commit b1b9596 into main Apr 20, 2026
3 checks passed
@MuncleUscles MuncleUscles deleted the feat/add-testnet-bradbury branch April 20, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant