-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Magically improve coverage #6345
Changes from 3 commits
cef3e6e
a82a494
550918c
98005bf
dba30e2
ccafb52
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,13 +14,14 @@ reportName="lcov-${CI_COMMIT:0:9}" | |
|
||
if [[ -n $1 ]]; then | ||
crate="--package $1" | ||
shift | ||
else | ||
crate="--all --exclude solana-local-cluster" | ||
fi | ||
|
||
coverageFlags=(-Zprofile) # Enable coverage | ||
coverageFlags+=("-Clink-dead-code") # Dead code should appear red in the report | ||
coverageFlags+=("-Ccodegen-units=1") # Disable ThinLTO which corrupts debuginfo (see [rustc issue #45511]). | ||
coverageFlags+=("-Ccodegen-units=1") # Disable code generation parallelism which is unsupported under -Zprofile (see [rustc issue #51705]). | ||
coverageFlags+=("-Cinline-threshold=0") # Disable inlining, which complicates control flow. | ||
coverageFlags+=("-Coverflow-checks=off") # Disable overflow checks, which create unnecessary branches. | ||
|
||
|
@@ -37,7 +38,9 @@ rm -rf target/cov/$reportName | |
|
||
source ci/rust-version.sh nightly | ||
# shellcheck disable=SC2086 # | ||
_ cargo +$rust_nightly test --target-dir target/cov --lib $crate | ||
RUST_LOG=solana=trace _ cargo +$rust_nightly test --target-dir target/cov --lib --no-run $crate "$@" | ||
# shellcheck disable=SC2086 # | ||
RUST_LOG=solana=trace _ cargo +$rust_nightly test --target-dir target/cov --lib $crate "$@" 2> /dev/null | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Separated compile and test for easier debugging because the messages from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why hide stderr here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Otherwise, tons of tons of logs will be printed on the terminal, after all we're running all test with trace level. Maybe, better off to note that as a comment? Or, should we stash the logs to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I see. Yes there are times when the build only fails in a coverage run in CI (we had an occurrence of this today in fact!) so being able to view the log could be helpful. We don't need anything fancy like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for explanation done 98005bf.. By the way, I'm guessing for the log file to be ranges of X00MB.. Let's see if its filesize is too big, or not... If that's concern, I'll just compress it via There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yay, build passed. Heh, I was pessimistic a bit, it seems. @mvines Hi, are ~100MB artifacts a bit concern? Should compress?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh wow. Sure please There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it really shrank!
|
||
|
||
echo "--- grcov" | ||
|
||
|
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.
To forward the rest to
cargo test
at https://github.com/solana-labs/solana/pull/6345/files#diff-c29225768574b8edd4f3608f595c29f7R41,shift
$1
here.