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

test(spread): make ros linter test less strict #4369

Merged
merged 3 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view

This file was deleted.

17 changes: 8 additions & 9 deletions tests/spread/core22/linters/linter-ros2-humble-mixed/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ execute: |

sed -n '/^Running linters/,/^Creating snap/p' < output.txt > linter_output.txt

# diff everything except the list of libraries
diff --ignore-matching-lines "^- library: lib" expected_linter_output.txt linter_output.txt

# `|| true` is used because grep will error if there is no output from the `diff` call
NUM_DIFFERENCES=$(diff expected_linter_output.txt linter_output.txt | grep --count "[<>]" || true)
# verify libpng library warning is filtered
if grep -qF "libpng" linter_output.txt; then
echo "Error: Unused library warning for libpng was not filtered."
exit 1
fi

# the list of unused libraries may change from time to time, so check the output is similar but not identical
if [[ $NUM_DIFFERENCES -gt 10 ]]; then
echo "Error: linter warnings are significantly different:"
diff --unified expected_linter_output.txt linter_output.txt
# verify ros2-humble library warnings are not filtered
if ! grep -q "^- library: .*: unused library 'opt/ros/.*'" linter_output.txt; then
echo "Error: Unused library warnings for ros2-humble libraries were filtered."
exit 1
fi