diff --git a/.circleci/python_job.bash b/.circleci/python_job.bash index d804f2b27f..15999c92d4 100644 --- a/.circleci/python_job.bash +++ b/.circleci/python_job.bash @@ -114,10 +114,10 @@ function run_check_glean { local HAS_DIFFS=0 local HAS_FILES=0 local EXIT_CODE=0 - for FILENAME in `find ${GLEAN_TEST_FOLDER} -type f -exec basename \{\} \;` + for FILENAME in `find ${GLEAN_TEST_FOLDER} -type f -name '*.py' -exec basename \{\} \;` do HAS_FILES=1 - if [[ 0 -ne `cmp --silent "${GLEAN_TEST_FOLDER}/${FILENAME}" "${GLEAN_OUTPUT_FOLDER}/${FILENAME}"` ]] + if /usr/bin/cmp --silent "${GLEAN_TEST_FOLDER}/${FILENAME}" "${GLEAN_OUTPUT_FOLDER}/${FILENAME}" then HAS_DIFFS=1 fi @@ -130,7 +130,8 @@ function run_check_glean { if [ $HAS_DIFFS -eq 1 ] then echo "*** Differences detected - need to re-run glean_parser ***" - diff $GLEAN_OUTPUT_FOLDER $GLEAN_TEST_FOLDER + diff --exclude '__pycache__' $GLEAN_OUTPUT_FOLDER $GLEAN_TEST_FOLDER || true + echo "*** End of differences***" EXIT_CODE=1 fi if [ "$GLEAN_TEST_FOLDER" != "" ] @@ -141,6 +142,15 @@ function run_check_glean { if [ $EXIT_CODE -eq 0 ] then echo "✓ Files are identical" + elif [ $HAS_DIFFS -eq 1 ] + then + echo + echo "To fix, run:" + echo + echo " bash .circleci/python_job.bash run build_glean" + echo + echo "and add as a commit to this pull request." + exit 1 else exit 1 fi