-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[move-compiler] Fix panic in coverage for inlined code, add controls to display tags and/or color in coverage source listings, don't lean on compiler v1 #14449
Conversation
b988e21
to
ee8bc20
Compare
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.
Great!
if cov.uncovered_locations.is_empty() { | ||
return vec![]; | ||
} | ||
|
||
let mut covs: Vec<_> = cov | ||
.uncovered_locations | ||
.iter() | ||
.filter(|loc| loc.file_hash() == file_hash) |
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.
This change introduces a new crash: #14454
It can be fixed by adding a check that if covs.is_empty() { return vec![]; }
right after creating covs
here.
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.
I had filed the crash while reviewing, but I did not realize until after filing the bug that the root cause was this change.
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.
Done.
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.
If you have tested the scenario mentioned in the issue and it is fixed, then you can mention in the PR description that it also fixes that issue so that it gets closed.
install_dir: move_options.output_dir.clone(), | ||
skip_fetch_latest_git_deps: move_options.skip_fetch_latest_git_deps, | ||
compiler_config: CompilerConfig { | ||
known_attributes: extended_checks::get_all_attribute_names().clone(), | ||
skip_attribute_checks: false, |
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.
Should skip_attribute_checks
also not be copied from move_options
?
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.
Done.
source_coverage | ||
.compute_source_coverage(source_path) | ||
.output_source_coverage(&mut std::io::stdout()) | ||
let t1 = source_coverage.compute_source_coverage(source_path); |
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.
Please undo or use better var names.
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.
Done.
source_cov | ||
.compute_source_coverage(source_path) | ||
.output_source_coverage(&mut coverage_writer) | ||
let t1 = source_cov.compute_source_coverage(source_path); |
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.
Please undo or use better var names.
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.
Done.
} | ||
|
||
#[derive(ValueEnum, Clone, Debug, Serialize)] | ||
pub enum TextIndicator { |
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.
Would be good to have a brief note on what these mean.
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.
Done.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #14449 +/- ##
=========================================
- Coverage 59.7% 59.6% -0.1%
=========================================
Files 844 844
Lines 205737 205834 +97
=========================================
+ Hits 122831 122845 +14
- Misses 82906 82989 +83 ☔ View full report in Codecov by Sentry. |
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.
Have one comment about checking whether an issue is fixed and marking it as so, approving assuming that will be done.
f92dedc
to
4dad30b
Compare
…Fix panic by dropping inlined code from source coverage listings.
4dad30b
to
a82f083
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
Description
Add controls for how
aptos move coverage source
displays covered source code:--color {none, default, always}
, by default keep current behavior--tag {none, explicit, on}
, when turnedexplicit
oron
, show+
and-
for covered/uncovered linesFix a panic for
aptos move coverage source --module features
onaptos-move/framework/move-stdlib
, caused by inlined lines beingmisattributed to the calling module.
Also fix
aptos move test --coverage
to not rely on V1 compiler.Issue #14448 created to track remaining coverage issues.
Fixes #14377
Fixes #14360
Fixes #14379
Fixes #14454
Type of Change
Which Components or Systems Does This Change Impact?
How Has This Been Tested?
Manual testing, piped to files and less, etc.
Key Areas to Review
Uncolored output of
aptos move coverage source --module features
now looks like:With color, lines are green with uncovered parts in red.
Checklist