Skip to content

Commit

Permalink
test(spread): make ros linter test less strict (#4369)
Browse files Browse the repository at this point in the history
Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
  • Loading branch information
mr-cal committed Sep 21, 2023
1 parent b357ef5 commit 8d0c451
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 48 deletions.

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

0 comments on commit 8d0c451

Please sign in to comment.