-
Notifications
You must be signed in to change notification settings - Fork 166
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
Export setup
module under test-utils
feature
#2247
Conversation
WalkthroughOhayo, sensei! The recent changes enhance the configurability and modularity of the codebase. Key modifications include the conditional instantiation of the Changes
Sequence Diagram(s)sequenceDiagram
participant A as Client
participant B as NodeService
participant C as Messaging
A->>B: Start NodeService
alt Messaging Enabled
A->>B: Create with Messaging
B->>C: Initialize Messaging
else Messaging Disabled
A->>B: Create without Messaging
end
Recent review detailsConfiguration used: .coderabbit.yaml Files selected for processing (5)
Files skipped from review due to trivial changes (2)
Files skipped from review as they are similar to previous changes (3)
TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add 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: 0
Outside diff range, codebase verification and nitpick comments (5)
crates/sozo/ops/src/tests/mod.rs (5)
1-1
: Ohayo sensei! Theauth
module cannot be made private.The
auth
module is used in multiple locations outside ofcrates/sozo/ops/src/tests/mod.rs
, including:
crates/sozo/ops/src/migration/migrate.rs
crates/sozo/ops/src/migration/auto_auth.rs
crates/sozo/ops/src/migration/utils.rs
bin/sozo/src/commands/mod.rs
bin/sozo/src/commands/auth.rs
Making the
auth
module private will break these references.Analysis chain
Verify the impact of making
auth
module private.The
auth
module is now private to the current module. Ensure that no external code relies on this module being public.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify no external code relies on the `auth` module being public. # Test: Search for external usage of the `auth` module. Expect: No occurrences of external usage. rg --type rust 'auth::' --glob '!crates/sozo/ops/src/tests/mod.rs'Length of output: 3818
5-5
: Ohayo, sensei!The
setup
module is still being used extensively across multiple test files. Removing thesetup
module declaration without addressing its usage will break these tests.
- Files impacted:
crates/sozo/ops/src/tests/auth.rs
crates/sozo/ops/src/tests/migration.rs
crates/sozo/ops/src/tests/utils.rs
crates/sozo/ops/src/tests/model.rs
crates/sozo/ops/src/tests/call.rs
Please ensure to either reintroduce the
setup
module or refactor the tests to remove dependencies on it.Analysis chain
Verify the impact of removing the
setup
module declaration.The
setup
module declaration has been removed. Ensure that no external code relies on this module.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify no external code relies on the `setup` module. # Test: Search for external usage of the `setup` module. Expect: No occurrences of external usage. rg --type rust 'setup::'Length of output: 3377
4-4
: Ohayo, sensei!The
model
module is being used in various places outside ofcrates/sozo/ops/src/tests/mod.rs
. Making this module private will break these dependencies. Please consider making themodel
module public again or refactor the code to avoid external dependencies on this module.
- External usages found:
crates/torii/libp2p/src/tests.rs
crates/torii/graphql/src/tests/mod.rs
crates/torii/graphql/src/schema.rs
crates/sozo/ops/src/auth.rs
crates/sozo/ops/src/register.rs
crates/dojo-world/src/manifest/mod.rs
crates/dojo-world/src/contracts/world.rs
crates/dojo-world/src/contracts/model.rs
crates/dojo-world/src/contracts/abi/model.rs
crates/dojo-lang/src/introspect/ty.rs
crates/dojo-lang/src/introspect/mod.rs
crates/dojo-lang/src/introspect/layout.rs
crates/dojo-lang/src/introspect/size.rs
crates/dojo-bindgen/src/lib.rs
crates/dojo-lang/src/plugin.rs
crates/dojo-lang/src/model.rs
crates/dojo-lang/src/event.rs
bin/sozo/src/commands/model.rs
bin/sozo/src/commands/mod.rs
Analysis chain
Verify the impact of making
model
module private.The
model
module is now private to the current module. Ensure that no external code relies on this module being public.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify no external code relies on the `model` module being public. # Test: Search for external usage of the `model` module. Expect: No occurrences of external usage. rg --type rust 'model::' --glob '!crates/sozo/ops/src/tests/mod.rs'Length of output: 21129
2-2
: Ohayo sensei,Making the
call
module private will break external references.The
call
module is used in:
bin/sozo/src/commands/call.rs
for invoking thecall
function.bin/sozo/src/commands/mod.rs
for importingCallArgs
.Making this module private will disrupt these references and break the functionality.
Analysis chain
Verify the impact of making
call
module private.The
call
module is now private to the current module. Ensure that no external code relies on this module being public.
Ohayo sensei,
Verify the impact of making
call
module private.The
call
module is referenced inbin/sozo/src/commands
. We need to ensure that making it private won't break functionality. Let's gather more information about the context of these references.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify no external code relies on the `call` module being public. # Test: Search for external usage of the `call` module. Expect: No occurrences of external usage. rg --type rust 'call::' --glob '!crates/sozo/ops/src/tests/mod.rs'Length of output: 600
Script:
#!/bin/bash # Description: Gather more detailed information about the usage context of `call` in `bin/sozo/src/commands`. # Display the lines around the usage of `call` in `bin/sozo/src/commands/mod.rs` and `bin/sozo/src/commands/call.rs`. rg --type rust -A 5 -B 5 'call::' bin/sozo/src/commands/mod.rs bin/sozo/src/commands/call.rsLength of output: 1355
3-3
: Ohayo, sensei!The removal of the
pub
keyword from themigration
module declaration has caused issues. There are multiple external references tomigration::
, which rely on the module being public. Here are some of the affected files:
crates/torii/grpc/src/server/tests/entities_test.rs
crates/torii/graphql/src/tests/mod.rs
crates/torii/core/src/sql_test.rs
crates/dojo-world/src/utils.rs
crates/sozo/ops/src/tests/model.rs
crates/sozo/ops/src/tests/migration.rs
crates/sozo/ops/src/test_utils/setup.rs
crates/sozo/ops/src/tests/auth.rs
crates/sozo/ops/src/utils.rs
crates/sozo/ops/src/register.rs
crates/dojo-world/src/contracts/world_test.rs
crates/sozo/ops/src/migration/auto_auth.rs
crates/sozo/ops/src/migration/utils.rs
crates/sozo/ops/src/migration/migrate.rs
crates/sozo/ops/src/migration/mod.rs
crates/saya/core/src/dojo_os/mod.rs
crates/sozo/ops/src/execute.rs
crates/sozo/ops/src/auth.rs
crates/sozo/ops/src/account.rs
crates/saya/core/src/verifier/starknet.rs
crates/dojo-test-utils/src/migration.rs
crates/dojo-world/src/manifest/manifest_test.rs
bin/sozo/tests/register_test.rs
bin/sozo/src/commands/migrate.rs
bin/sozo/src/commands/options/transaction.rs
bin/sozo/src/commands/options/account/controller.rs
You might want to reconsider making the
migration
module public again to avoid these issues.Analysis chain
Verify the impact of making
migration
module private.The
migration
module is now private to the current module. Ensure that no external code relies on this module being public.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify no external code relies on the `migration` module being public. # Test: Search for external usage of the `migration` module. Expect: No occurrences of external usage. rg --type rust 'migration::' --glob '!crates/sozo/ops/src/tests/mod.rs'Length of output: 4619
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.
fmt
and then let's merge, thanks for the refactoring here.
In-fine we will surely move the setup
part into dojo-test-utils
actually. As this may be re-used elsewhere too, wdyt? This also avoids the feature here and we will only use the dev
dependencies without loading the final binary with test related stuff.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2247 +/- ##
==========================================
+ Coverage 70.14% 70.18% +0.03%
==========================================
Files 343 344 +1
Lines 45199 45250 +51
==========================================
+ Hits 31707 31760 +53
+ Misses 13492 13490 -2 ☔ View full report in Codecov by Sentry. |
yeah, good point. |
Summary by CodeRabbit
New Features
test_utils
module to improve testing capabilities with utility functions.setup
module for streamlined test setups.Bug Fixes
Chores