Skip to content

tests: dump output of invoked commands #302

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

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

Conversation

cgzones
Copy link
Contributor

@cgzones cgzones commented Apr 9, 2025

Dump the output of invoked commands in the functional tests, so that they are shown when the testcase fails, to ease debugging. (The output is not shown in case the testcase succeeds.)

Inspired due to a valgrind failure on armhf on Debian buildd.

[ "$status" -eq 0 ]
count=$(echo ${output} | grep -o "W-002" | wc -l)
echo "Status: $status, Count: $count (expected 1)"
echo $output
echo ${output}
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this and the remaining echo calls in this function just be dropped? It looks like it's just printing the same output four times in a row.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

true, dropped superfluous statements

[ "$status" -eq 0 ]
count=$(echo ${output} | grep -o "W-002" | wc -l)
echo "Status: $status, Count: $count (expected 0)"
echo $output
echo ${output}
Copy link
Member

Choose a reason for hiding this comment

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

As above, this one now seems redundant to the one above.

Copy link
Member

Choose a reason for hiding this comment

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

(In this case, the subsequent ones in the function all follow a run, so for this test, it's just this line that I think needs dropping).

Dump the output of invoked commands in the functional tests, so that
they are shown when the testcase fails, to ease debugging. (The output
is not shown in case the testcase succeeds.)

Inspired due to a valgrind failure on armhf on Debian buildd.
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.

2 participants