Skip to content
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

dev(sozo): improve test coverage and other few changes #1462

Merged
merged 13 commits into from
Jan 23, 2024

Conversation

lambda-0x
Copy link
Collaborator

@lambda-0x lambda-0x commented Jan 19, 2024

  • fixed argument priority for AccountOptions to be consistent with other places
  • added tests for AccountOptions
  • added tests for BuildArgs
  • removed redundant logic from MigrateArgs::run

@lambda-0x lambda-0x marked this pull request as draft January 19, 2024 13:45
@codecov-commenter
Copy link

codecov-commenter commented Jan 20, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (3620d72) 68.03% compared to head (1a06000) 69.40%.

Files Patch % Lines
bin/sozo/src/commands/migrate.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1462      +/-   ##
==========================================
+ Coverage   68.03%   69.40%   +1.37%     
==========================================
  Files         228      228              
  Lines       22074    22138      +64     
==========================================
+ Hits        15017    15364     +347     
+ Misses       7057     6774     -283     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lambda-0x lambda-0x marked this pull request as ready for review January 21, 2024 07:28
crates/sozo/src/commands/migrate.rs Outdated Show resolved Hide resolved

use super::BuildArgs;

// this adds considerable time to test suite, should this be enabled by default?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this should be done as part of the dojo-test-utils build.rs already?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build.rs has it but it doesn't generate bindings. since build is done this shouldn't be expensive to do assuming cairo compiler does incremental builds

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the plugin system is something that is done post-compilation, what's generated by build.rs from dojo-test-utils is enough to run tests. But this is done inside the dojo-bindgen crate.

Inside sozo, it's currently not possible to decouple the build from the plugin system being invoked after compilation. For this reason, if the time to execute the test suite must remain reasonable, we can remove this test for now.

However, when the dry-run option will be available, we could imagine sozo outputting the migration strategy + the plugins that are expected to run. Like this, sozo tests cover the plugin integration, but not the actual bindings generation (which is expected to be tested in dojo-bindgen).

Sounds reasonable to you guys?

@lambda-0x
Copy link
Collaborator Author

(ci failure looks unrelated)

@tarrencev tarrencev merged commit 25fbb7f into dojoengine:main Jan 23, 2024
12 checks passed
@lambda-0x lambda-0x deleted the sozo-improvements branch January 24, 2024 03:16
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.

4 participants