run_all_examples.bash should fail CI when single example fails
EXAMPLES_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
MOLER_REPO_DIR="$( cd $EXAMPLES_DIR/.. >/dev/null && pwd )"
+exit_status=0
+
for file in `find $EXAMPLES_DIR -name "*.py" -print`
do
echo "**********************************************************************************"
@@ -8,6 +10,14 @@ do
echo "* RUNNING: $file"
echo "*"
echo "**********************************************************************************"
- (export PYTHONPATH=$MOLER_REPO_DIR:$PYTHONPATH; python3.6 $file)
+
+ export PYTHONPATH=$MOLER_REPO_DIR:$PYTHONPATH
+ python3.6 $file
+ single_example_exit_status=$?
+
+ if [ $single_example_exit_status != 0 ]
+ then exit_status=$single_example_exit_status
+ fi
echo
done
+exit $exit_status
