blob: 4be4b4c2d9fe122e604400a7ea63e8e29a833fd0 [file] [log] [blame]
#!/bin/bash
cd $WORKSPACE
rm -rf OnosSystemTest
rm -f pep8Result.txt
git clone https://gerrit.onosproject.org/OnosSystemTest; cd OnosSystemTest
git review -d ${GERRIT_CHANGE_NUMBER}
cd
cd $WORKSPACE/OnosSystemTest/
modifiedFiles=$(git diff-tree --no-commit-id --name-only -r HEAD | grep \.py$) || modifiedFiles=""
if [ -n "$modifiedFiles" ]
then
pep8 --repeat --show-source --show-pep8 --ignore=E251,E201,E302,E202,E126,E127,E203,E226,E501,W391 $modifiedFiles > $WORKSPACE/pep8Result.txt
else
touch $WORKSPACE/pep8Result.txt
rm -rf $WORKSPACE/OnosSystemTest/
echo "There were no files to code check, failing test so Jenkins doesn't comment."
exit 2
fi
cat $WORKSPACE/pep8Result.txt
rm -rf $WORKSPACE/OnosSystemTest/