test: remove #[test_only] from *_tests modules#389
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe PR uniformly removes ChangesRemove #[test_only] from test modules across all packages
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #389 +/- ##
=======================================
Coverage 78.90% 78.90%
=======================================
Files 23 23
Lines 1782 1782
Branches 640 640
=======================================
Hits 1406 1406
Misses 341 341
Partials 35 35
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Do we have to remove them though? Is there a benefit from removing them that outweights quickly recognizing these items as test only? I think it helps with understanding the code faster visually. |
As per docs, the
#[test_only]attribute is used to only include the annotated code in the final bytecode output if themodeis set totest, i.e.sui move build --mode testorsui move test(uses--mode testby default).This is used when some module in the
sources/*contains test-specific code (see move best practices)However, any module inside the
tests/*directory is by default only ever included in the final bytecode if--mode testis set (see Move Book > Packages).Confirmed this claim locally.
Removing the attribute from modules inside
tests/*results in no bytecode changes in any mode.Summary by CodeRabbit