github.com/noironetworks/cilium-net@v1.6.12/contrib/scripts/check-assert-deep-equals.sh (about)

     1  #!/bin/bash
     2  
     3  # check-assert-deep-equals.sh checks whether DeepEquals checker from
     4  # pkg/checker is used every time instead of the checker from gopkg.in/check.v1.
     5  # If not, it returns an error. Cilium implements its own DeepEquals checker
     6  # which gives a more detailed trace when the assertion fails.
     7  
     8  set -eu
     9  
    10  if grep -IPRns 'c.Assert\(.*, (check\.)?DeepEquals, .*\)' \
    11          --exclude-dir=vendor \
    12          --include=*.go; then
    13      echo "Found tests which use DeepEquals checker imported from check.v1."
    14      echo "Cilium implements its own DeepEquals checker which can be imported from:"
    15      echo -e "\tgithub.com/cilium/cilium/pkg/checker"
    16      echo "It gives a more detailed trace when the assertion fails."
    17      exit 1
    18  fi