Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThis PR renames the SDK initialization function from Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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.
🧹 Nitpick comments (5)
sdk/packages/python/iii/tests/test_init_api.py (3)
28-30: Consider renaming test function for consistency.Similarly,
test_init_requires_running_loopshould be renamed totest_register_worker_requires_running_loop.♻️ Suggested rename
-def test_init_requires_running_loop() -> None: +def test_register_worker_requires_running_loop() -> None: with pytest.raises(RuntimeError, match="active asyncio event loop"): register_worker("ws://fake")🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@sdk/packages/python/iii/tests/test_init_api.py` around lines 28 - 30, Rename the test function test_init_requires_running_loop to test_register_worker_requires_running_loop to match naming consistency; update the function definition in the test file (the def that calls register_worker("ws://fake") and asserts the RuntimeError about active asyncio event loop) so the function name reflects register_worker.
13-25: Consider renaming test functions for consistency.Test function names still reference
initbut now testregister_worker. Consider renaming for consistency:
test_init_schedules_connect→test_register_worker_schedules_connect♻️ Suggested rename
`@pytest.mark.anyio` -async def test_init_schedules_connect(monkeypatch: pytest.MonkeyPatch) -> None: +async def test_register_worker_schedules_connect(monkeypatch: pytest.MonkeyPatch) -> None: called = asyncio.Event()🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@sdk/packages/python/iii/tests/test_init_api.py` around lines 13 - 25, Rename the test function to reflect the behavior under test: change the test name `test_init_schedules_connect` to `test_register_worker_schedules_connect` so it matches the use of `register_worker` and the patched `III.connect`; update the test definition line for the async test and any references to the old name in the file accordingly.
33-62: Consider renaming test function for consistency.
test_connect_consumes_otel_from_init_optionscould be renamed totest_connect_consumes_otel_from_register_worker_optionsor similar.♻️ Suggested rename
`@pytest.mark.anyio` -async def test_connect_consumes_otel_from_init_options(monkeypatch: pytest.MonkeyPatch) -> None: +async def test_connect_consumes_otel_from_register_worker_options(monkeypatch: pytest.MonkeyPatch) -> None: import iii.telemetry as telemetry🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@sdk/packages/python/iii/tests/test_init_api.py` around lines 33 - 62, Rename the test function test_connect_consumes_otel_from_init_options to a name that reflects the actual API under test (e.g., test_connect_consumes_otel_from_register_worker_options) so it matches the usage of register_worker and InitOptions in the test; update the function definition and any references to the old name (the test function itself and any test discovery references) to the new name to keep naming consistent with register_worker and InitOptions.sdk/packages/rust/iii/tests/init_api.rs (2)
12-19: Consider renaming test function for consistency.The test function is still named
init_with_runtime_returns_sdk_instancebut it now testsregister_worker. Consider renaming toregister_worker_with_runtime_returns_sdk_instancefor consistency with the first test function which was renamed.♻️ Suggested rename
#[tokio::test] -async fn init_with_runtime_returns_sdk_instance() { +async fn register_worker_with_runtime_returns_sdk_instance() { let client = register_worker("ws://127.0.0.1:49134", InitOptions::default()) .expect("register_worker should succeed inside Tokio runtime");🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@sdk/packages/rust/iii/tests/init_api.rs` around lines 12 - 19, Rename the test function init_with_runtime_returns_sdk_instance to register_worker_with_runtime_returns_sdk_instance so the name reflects that it tests register_worker; update the function signature fn init_with_runtime_returns_sdk_instance() to fn register_worker_with_runtime_returns_sdk_instance() and ensure the #[tokio::test] annotated function and any references to it (if any) are updated accordingly.
21-39: Consider renaming test function for consistency.Similarly,
init_applies_otel_config_before_auto_connectshould be renamed to match the new API naming convention.♻️ Suggested rename
#[cfg(feature = "otel")] #[tokio::test] -async fn init_applies_otel_config_before_auto_connect() { +async fn register_worker_applies_otel_config_before_auto_connect() { use iii_sdk::OtelConfig;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@sdk/packages/rust/iii/tests/init_api.rs` around lines 21 - 39, Rename the test function init_applies_otel_config_before_auto_connect to follow the project's new test naming convention (keep the same test body using register_worker, InitOptions and OtelConfig) — update the function declaration name and any references so the test name matches other tests in the suite (e.g., use the new API-style name used elsewhere for init tests) while leaving register_worker, InitOptions, OtelConfig and the test logic unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@sdk/packages/python/iii/tests/test_init_api.py`:
- Around line 28-30: Rename the test function test_init_requires_running_loop to
test_register_worker_requires_running_loop to match naming consistency; update
the function definition in the test file (the def that calls
register_worker("ws://fake") and asserts the RuntimeError about active asyncio
event loop) so the function name reflects register_worker.
- Around line 13-25: Rename the test function to reflect the behavior under
test: change the test name `test_init_schedules_connect` to
`test_register_worker_schedules_connect` so it matches the use of
`register_worker` and the patched `III.connect`; update the test definition line
for the async test and any references to the old name in the file accordingly.
- Around line 33-62: Rename the test function
test_connect_consumes_otel_from_init_options to a name that reflects the actual
API under test (e.g., test_connect_consumes_otel_from_register_worker_options)
so it matches the usage of register_worker and InitOptions in the test; update
the function definition and any references to the old name (the test function
itself and any test discovery references) to the new name to keep naming
consistent with register_worker and InitOptions.
In `@sdk/packages/rust/iii/tests/init_api.rs`:
- Around line 12-19: Rename the test function
init_with_runtime_returns_sdk_instance to
register_worker_with_runtime_returns_sdk_instance so the name reflects that it
tests register_worker; update the function signature fn
init_with_runtime_returns_sdk_instance() to fn
register_worker_with_runtime_returns_sdk_instance() and ensure the
#[tokio::test] annotated function and any references to it (if any) are updated
accordingly.
- Around line 21-39: Rename the test function
init_applies_otel_config_before_auto_connect to follow the project's new test
naming convention (keep the same test body using register_worker, InitOptions
and OtelConfig) — update the function declaration name and any references so the
test name matches other tests in the suite (e.g., use the new API-style name
used elsewhere for init tests) while leaving register_worker, InitOptions,
OtelConfig and the test logic unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 51c7b739-265f-46f3-9936-6e46a720465e
📒 Files selected for processing (12)
frameworks/motia/motia-js/packages/motia/src/new/iii.tssdk/packages/node/iii-example/src/iii.tssdk/packages/node/iii/src/iii.tssdk/packages/node/iii/src/index.tssdk/packages/node/iii/tests/exports.test.tssdk/packages/node/iii/tests/utils.tssdk/packages/python/iii-example/src/main.pysdk/packages/python/iii/src/iii/__init__.pysdk/packages/python/iii/tests/test_init_api.pysdk/packages/rust/iii-example/src/main.rssdk/packages/rust/iii/src/lib.rssdk/packages/rust/iii/tests/init_api.rs
Summary by CodeRabbit