-
Notifications
You must be signed in to change notification settings - Fork 11.6k
[move] Add test-ony coverage gathering and differential test coverage #22007
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] Add test-ony coverage gathering and differential test coverage #22007
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
b97a62a
to
75ac6e4
Compare
75ac6e4
to
24c03da
Compare
24c03da
to
378924b
Compare
differential: Option<String>, | ||
/// Compute coverage for the provided test name. Only this test will contribute to the | ||
/// coverage calculation. | ||
#[clap(long = "only-test", conflicts_with = "differential")] |
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 this be an enum? Or is that more trouble than it is worth?
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 looked into it and it's possible, but I'd classify it as more trouble than it's worth and leads to a (IMHO) slightly weird command texture where differential
and only-test
become subcommands as opposed to args/flags.
2b75801
to
9adaf27
Compare
378924b
to
a082257
Compare
9adaf27
to
f2d7eca
Compare
a082257
to
bad1f36
Compare
…#22007) ## Description This builds on top of the LCOV support for Move in the PR below this to add two new commands: * `--only-test <test-name>` where `test-name` is the name of the test (can be either the function name or `module_name::function_name` of the test). * `--differential-test <test-name>` this computes the "differential coverage" as inspired by [this article](https://research.swtch.com/diffcover). Basically for a test `T` - If the code is hit only by `T` then it will show as "covered" - If the code is hit by both `T` and other tests than it will show as "uncovered" - If the code is either not hit at all, or only by other tests, then it will not show up as covered/uncovered at all. ## Test plan Added tests to the Move CLI for this. Some examples of the output ``` move coverage lcov ```  ``` move coverage lcov --only-test f21 ```  ``` move coverage lcov --differential-test f21 ```  --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] gRPC: - [ ] JSON-RPC: - [ ] GraphQL: - [X] CLI: Adds support for more advanced LCOV-based Move coverage information -- both individual and differential test summary information is now supported. - [ ] Rust SDK:
Description
This builds on top of the LCOV support for Move in the PR below this to add two new commands:
--only-test <test-name>
wheretest-name
is the name of the test (can be either the function name ormodule_name::function_name
of the test).--differential-test <test-name>
this computes the "differential coverage" as inspired by this article. Basically for a testT
T
then it will show as "covered"T
and other tests than it will show as "uncovered"Test plan
Added tests to the Move CLI for this.
Some examples of the output
Release notes
Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.
For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.