blob: 9e26c36215e6afe415816c4c6fdd2bac4635b8f2 [file] [log] [blame]
Devin Lim18f459d2018-01-26 19:20:30 -08001#!/bin/bash
2
Devin Lim157404d2018-02-09 16:44:19 -08003cd $WORKSPACE
4rm -rf OnosSystemTest
5rm -f pep8Result.txt
6git clone https://gerrit.onosproject.org/OnosSystemTest; cd OnosSystemTest
7git review -d ${GERRIT_CHANGE_NUMBER}
8
Devin Lim18f459d2018-01-26 19:20:30 -08009cd
10cd $WORKSPACE/OnosSystemTest/
11modifiedFiles=$(git diff-tree --no-commit-id --name-only -r HEAD | grep \.py) || modifiedFiles=""
12if [ -n "$modifiedFiles" ]
13then
14 pep8 --repeat --show-source --show-pep8 --ignore=E251,E201,E302,E202,E126,E127,E203,E226,E501,W391 $modifiedFiles > $WORKSPACE/pep8Result.txt
15else
16 touch $WORKSPACE/pep8Result.txt
17 rm -rf $WORKSPACE/OnosSystemTest/
18 echo "There were no files to code check, failing test so Jenkins doesn't comment."
19 exit 2
Devin Lim59f6d1a2018-02-09 17:18:56 -080020fi
21
22cat $WORKSPACE/pep8Result.txt
23rm -rf $WORKSPACE/OnosSystemTest/