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

Add a script to produce combined fuzzing coverage profiles. #24

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Crypt-iQ
Copy link
Collaborator

@Crypt-iQ Crypt-iQ commented Oct 8, 2024

Pretty much a copy of corpus_merge.sh. After running the script, go to your lnd directory then run go tool cover -html ../lnd-fuzz/coverage/profile to see coverage in HTML.

Addresses part of #10

@Roasbeef Roasbeef requested a review from gijswijs October 17, 2024 17:48
Copy link
Contributor

@morehouse morehouse left a comment

Choose a reason for hiding this comment

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

Concept ACK

cov_profiles.sh Outdated

# Collect coverage profiles.
for p in ${packages[@]}; do
cd $PWD/$p/testdata/fuzz
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems BASE_DIR and PWD are being used interchangeably, but it is possible the user runs cov_profiles.sh from a directory other than lnd-fuzz.

We should only use BASE_DIR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

that is true in the above case but not in for f in $(ls $PWD); do

cov_profiles.sh Outdated Show resolved Hide resolved
cov_profiles.sh Outdated Show resolved Hide resolved
cov_profiles.sh Outdated Show resolved Hide resolved
cov_profiles.sh Outdated Show resolved Hide resolved
cov_profiles.sh Outdated Show resolved Hide resolved
cov_profiles.sh Outdated Show resolved Hide resolved
cov_profiles.sh Outdated Show resolved Hide resolved
cov_profiles.sh Outdated Show resolved Hide resolved
cov_profiles.sh Outdated Show resolved Hide resolved
@Crypt-iQ Crypt-iQ force-pushed the cov_profiles_10_07_2024 branch from 82d98b2 to 6b373e3 Compare October 25, 2024 02:44
@Crypt-iQ Crypt-iQ requested a review from morehouse October 29, 2024 16:05
cov_profiles.sh Outdated Show resolved Hide resolved
cov_profiles.sh Outdated Show resolved Hide resolved
cov_profiles.sh Outdated Show resolved Hide resolved
cov_profiles.sh Outdated Show resolved Hide resolved
cov_profiles.sh Outdated Show resolved Hide resolved
Copy link
Collaborator

@gijswijs gijswijs left a comment

Choose a reason for hiding this comment

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

This is a very nice improvement. Concept ACK

Made some remarks throughout.

cov_profiles.sh Outdated Show resolved Hide resolved
cov_profiles.sh Outdated Show resolved Hide resolved
for p in ${packages[@]}; do
cd "${BASE_DIR}/${p}/testdata/fuzz"

for f in $(ls $PWD); do
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can use for with a glob pattern. ./* is safer than * but both work in this case.

Suggested change
for f in $(ls $PWD); do
for f in ./*; do

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For some reason this did not work for me

cov_profiles.sh Show resolved Hide resolved
cov_profiles.sh Outdated Show resolved Hide resolved
@lightninglabs-deploy
Copy link

@Crypt-iQ, remember to re-request review from reviewers when ready

@Crypt-iQ Crypt-iQ force-pushed the cov_profiles_10_07_2024 branch from 6b373e3 to 9054ca1 Compare December 10, 2024 16:51
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