Skip to content

Commit

Permalink
run tests only when changes in folder #6208
Browse files Browse the repository at this point in the history
  • Loading branch information
knmkr authored and titusfortner committed Apr 17, 2019
1 parent 9226cfd commit ef93714
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions scripts/travis/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,41 @@ if [[ $TOXENV == *"remote"* ]]; then
./go selenium-server-standalone
fi

# Tests will be run only when each folder, such as /py, is modified
if [[ ! -z $TOXENV ]]; then
tox -c py/tox.ini
if git diff --name-only HEAD~1| grep '^py/' >/dev/null; then
tox -c py/tox.ini
fi
fi

# Ordering matters here. We want rake tasks to run first
if [[ ! -z $TASK ]]; then
./go $TASK
if [[ $TASK == //rb:* ]]; then
if git diff --name-only HEAD~1| grep '^rb/' >/dev/null; then
./go $TASK
fi
else
./go $TASK
fi
fi

if [[ ! -z "$BUCK" ]]; then
./buckw $BUCK
if [[ $BUCK == test\ //javascript/* ]]; then
if git diff --name-only HEAD~1| grep '^javascript/' >/dev/null; then
./buckw $BUCK
fi
elif [[ $BUCK == test\ * ]]; then
if git diff --name-only HEAD~1| grep '^java/' >/dev/null; then
./buckw $BUCK
fi
else
./buckw $BUCK
fi
fi

if [[ ! -z "$NPM" ]]; then
./go node:atoms
cd javascript/node/selenium-webdriver; npm install; npm run $NPM
if git diff --name-only HEAD~1| grep '^javascript/' >/dev/null; then
./go node:atoms
cd javascript/node/selenium-webdriver; npm install; npm run $NPM
fi
fi

0 comments on commit ef93714

Please sign in to comment.