Skip to content

Conversation

@Crypt-iQ
Copy link
Contributor

@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
Contributor 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

@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
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
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
Contributor 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

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

Tried to test the script, but it's broken for me. See inline comments.

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.

Apart from @morehouse remarks, there's nothing left to do afaict. Once the script is fixed I'm confident Matt can give it the final stamp of approval, so I'm giving it mine right now. 🎉

Roasbeef and others added 4 commits April 16, 2025 14:10
Co-authored-by: Matt Morehouse <[email protected]>
Co-authored-by: Matt Morehouse <[email protected]>
Co-authored-by: Matt Morehouse <[email protected]>
Co-authored-by: Matt Morehouse <[email protected]>

# Collect coverage profiles.
for p in ${PACKAGES[@]}; do
pushd "${BASE_DIR}/${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.

AFAICT this pushd and the matching popd are useless and should be removed.


coverage_dirs+=("coverage/${f}")

popd
Copy link
Contributor

Choose a reason for hiding this comment

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

At this point I think we should do rm -r "${CACHE_DIR}/${f}" to ensure that fuzz targets with the same name will never cross-contaminate each others' corpus.

@lightninglabs-deploy
Copy link

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

@guggero
Copy link
Contributor

guggero commented Aug 19, 2025

!lightninglabs-deploy mute

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.

6 participants