test: cover studio message fee edge cases#1651
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughExpose Mode1 GenVM execution in studio fees; migrate tests and embedded contracts to ChangesGenVM Execution and Fee Updates
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/genvm-lint.yml (1)
5-17:⚠️ Potential issue | 🟠 Major | ⚡ Quick winTrigger paths include
tests/integration/icontracts/contracts/**but the lint steps never lint them.The workflow triggers on changes under
tests/integration/icontracts/contracts/**(lines 9 and 17), yet the two lint loops only iterate overexamples/contracts/*.py(line 41) andtests/load/contracts/*.py tests/direct/contracts/*.py(line 56). The integration contracts migrated in this PR will trigger the job but go unlinted, so the migration is not actually validated here.Either add the integration contracts to a lint loop or drop them from the trigger paths to avoid a misleading green check.
🔧 Example: lint integration contracts too
- name: Lint test contracts env: # These test contracts currently pin v0.2.x runner hashes. GENVM_VERSION: v0.2.16 run: | failed=0 - for f in tests/load/contracts/*.py tests/direct/contracts/*.py; do + for f in tests/load/contracts/*.py tests/direct/contracts/*.py tests/integration/icontracts/contracts/**/*.py; do [ -f "$f" ] || continue echo "::group::$f" if ! genvm-lint check "$f"; then failed=1 fi echo "::endgroup::" done exit $failedAlso applies to: 39-64
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/genvm-lint.yml around lines 5 - 17, The workflow triggers include "tests/integration/icontracts/contracts/**" but the lint loops only iterate over "examples/contracts/*.py" and "tests/load/contracts/*.py tests/direct/contracts/*.py", so integration contracts are not linted; either add the integration pattern to the lint loops (e.g., include "tests/integration/icontracts/contracts/*.py" in the arrays or loop that processes "examples/contracts/*.py" and the load/direct patterns) or remove "tests/integration/icontracts/contracts/**" from the workflow triggers to avoid a misleading pass — update the path patterns in the lint job to include the integration contracts or remove them from the trigger paths accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/genvm-lint.yml:
- Around line 32-33: The CI workflow installs genvm-linter from a specific
commit that packages as genvm-linter==0.10.0 while requirements.txt pins
genvm-linter==0.7.1, causing mismatched lint behavior; pick one canonical
version and make both places consistent: either update requirements.txt to pin
genvm-linter==0.10.0 (or a matching released tag) and keep the workflow
commit/installation, or change the genvm-lint workflow to install the release
matching 0.7.1 (or use pip install genvm-linter==0.7.1); ensure the console
entry genvm-lint still maps to genvm_linter.cli:cli and update the single source
of truth (requirements.txt or the workflow) accordingly.
---
Outside diff comments:
In @.github/workflows/genvm-lint.yml:
- Around line 5-17: The workflow triggers include
"tests/integration/icontracts/contracts/**" but the lint loops only iterate over
"examples/contracts/*.py" and "tests/load/contracts/*.py
tests/direct/contracts/*.py", so integration contracts are not linted; either
add the integration pattern to the lint loops (e.g., include
"tests/integration/icontracts/contracts/*.py" in the arrays or loop that
processes "examples/contracts/*.py" and the load/direct patterns) or remove
"tests/integration/icontracts/contracts/**" from the workflow triggers to avoid
a misleading pass — update the path patterns in the lint job to include the
integration contracts or remove them from the trigger paths accordingly.
🪄 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: 5fef2db0-e353-4da4-ac26-b010bffb3e67
📒 Files selected for processing (7)
.github/workflows/genvm-lint.ymltests/integration/icontracts/contracts/error_execution_contract.pytests/integration/icontracts/contracts/intelligent_oracle_factory.pytests/integration/icontracts/contracts/multi_file_contract/__init__.pytests/integration/icontracts/contracts/multi_read_erc20.pytests/integration/icontracts/contracts/multi_tenant_storage.pytests/integration/icontracts/contracts/read_erc20.py
🚧 Files skipped from review as they are similar to previous changes (2)
- tests/integration/icontracts/contracts/error_execution_contract.py
- tests/integration/icontracts/contracts/multi_tenant_storage.py
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/integration/icontracts/conftest.py (1)
46-64: 💤 Low valuePolling loop aborts on the first transient RPC failure.
assert has_success_status(validators_result)inside the poll loop turns a single transient non-success response into an immediateAssertionError, defeating the purpose of retrying until the timeout. Consider treating a non-success response as a retryable iteration instead.♻️ Optional: retry on transient failures
while time.monotonic() < deadline: validators_result = post_request_localhost( payload("sim_getAllValidators") ).json() - assert has_success_status(validators_result) - last_count = len(validators_result.get("result", [])) + if not has_success_status(validators_result): + time.sleep(0.5) + continue + last_count = len(validators_result.get("result", [])) if last_count >= min_count:🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/integration/icontracts/conftest.py` around lines 46 - 64, The poll loop in _wait_for_validator_count should not abort on a single transient RPC failure; replace the assert has_success_status(validators_result) with logic that treats non-success responses as retryable (e.g., if not has_success_status(validators_result): time.sleep(0.5); continue), and only parse/update last_count when has_success_status returns True (using post_request_localhost and validators_result.get("result", []) accordingly), keeping the existing timeout behavior and final AssertionError if min_count is not reached.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/integration/icontracts/conftest.py`:
- Around line 46-64: The poll loop in _wait_for_validator_count should not abort
on a single transient RPC failure; replace the assert
has_success_status(validators_result) with logic that treats non-success
responses as retryable (e.g., if not has_success_status(validators_result):
time.sleep(0.5); continue), and only parse/update last_count when
has_success_status returns True (using post_request_localhost and
validators_result.get("result", []) accordingly), keeping the existing timeout
behavior and final AssertionError if min_count is not reached.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 677e9cb3-f8d0-42c4-9bb2-b6186d95dc4e
📒 Files selected for processing (19)
.github/workflows/backend_integration_tests_pr.yml.github/workflows/frontend-unit-tests.yml.github/workflows/load-test-oha.yml.github/workflows/unit-tests-pr.ymlexamples/contracts/log_indexer.pytests/integration/icontracts/conftest.pytests/integration/icontracts/contracts/company_naming.pytests/integration/icontracts/contracts/error_execution_contract.pytests/integration/icontracts/contracts/error_llm_contract.pytests/integration/icontracts/contracts/error_web_contract.pytests/integration/icontracts/contracts/genvm_smoke_v1.pytests/integration/icontracts/contracts/intelligent_oracle.pytests/integration/icontracts/contracts/intelligent_oracle_factory.pytests/integration/icontracts/contracts/multi_file_contract/__init__.pytests/integration/icontracts/contracts/multi_file_contract/other.pytests/integration/icontracts/contracts/multi_read_erc20.pytests/integration/icontracts/contracts/multi_tenant_storage.pytests/integration/icontracts/contracts/read_erc20.pytests/integration/icontracts/contracts/utf8_roundtrip_contract.py
✅ Files skipped from review due to trivial changes (1)
- tests/integration/icontracts/contracts/intelligent_oracle.py
🚧 Files skipped from review as they are similar to previous changes (1)
- tests/integration/icontracts/contracts/multi_file_contract/init.py



Summary
Validation
Summary by CodeRabbit
New Features
Bug Fixes
Chores
Tests