Skip to content

Commit

Permalink
Fix check_glean job
Browse files Browse the repository at this point in the history
  • Loading branch information
jwhitlock committed Mar 11, 2024
1 parent 629eff9 commit 7513741
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .circleci/python_job.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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" != "" ]
Expand All @@ -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
Expand Down

0 comments on commit 7513741

Please sign in to comment.