diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2019-10-07 02:33:53 +0300 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2019-10-07 02:33:53 +0300 |
commit | 9fc305259b21f8daa377e9ef1159487d8c2d2f82 (patch) | |
tree | 877f86d4aa1898316c5adc6106e3b49094ae9b35 /tests | |
parent | 941ca99a868971f06ef8678b57520304cd90d277 (diff) |
Do not run tests when PHP files of other types of tests are modified
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/drone-run-acceptance-tests.sh | 2 | ||||
-rwxr-xr-x | tests/drone-run-integration-tests.sh | 2 | ||||
-rwxr-xr-x | tests/drone-run-php-tests.sh | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/tests/drone-run-acceptance-tests.sh b/tests/drone-run-acceptance-tests.sh index 216715cdc..fac071470 100755 --- a/tests/drone-run-acceptance-tests.sh +++ b/tests/drone-run-acceptance-tests.sh @@ -8,7 +8,7 @@ echo "=========================" [[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | wc -l) -eq 0 ]] && echo "No files are modified => merge commit" && exit 0 -[[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | grep -c ".php$") -gt 0 ]] && echo "PHP files are modified" && exit 0 +[[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | grep --invert-match "^tests/" | grep -c ".php$") -gt 0 ]] && echo "PHP files are modified" && exit 0 [[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | grep -c "^tests/acceptance/") -gt 0 ]] && echo "Acceptance test files are modified" && exit 0 diff --git a/tests/drone-run-integration-tests.sh b/tests/drone-run-integration-tests.sh index 9b805c8a2..4563eaefc 100755 --- a/tests/drone-run-integration-tests.sh +++ b/tests/drone-run-integration-tests.sh @@ -8,7 +8,7 @@ echo "=========================" [[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | wc -l) -eq 0 ]] && echo "No files are modified => merge commit" && exit 0 -[[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | grep -c ".php$") -gt 0 ]] && echo "PHP files are modified" && exit 0 +[[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | grep --invert-match "^tests/" | grep -c ".php$") -gt 0 ]] && echo "PHP files are modified" && exit 0 [[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | grep -c "^tests/integration/") -gt 0 ]] && echo "Integration test files are modified" && exit 0 diff --git a/tests/drone-run-php-tests.sh b/tests/drone-run-php-tests.sh index 9ae87cf9a..4c6611475 100755 --- a/tests/drone-run-php-tests.sh +++ b/tests/drone-run-php-tests.sh @@ -8,7 +8,7 @@ echo "=========================" [[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | wc -l) -eq 0 ]] && echo "No files are modified => merge commit" && exit 0 -[[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | grep -c ".php$") -gt 0 ]] && echo "PHP files are modified" && exit 0 +[[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | grep --invert-match "^tests/" | grep -c ".php$") -gt 0 ]] && echo "PHP files are modified" && exit 0 [[ $(git diff --name-only origin/$DRONE_TARGET_BRANCH...$DRONE_COMMIT_SHA | grep -c "^tests/php/") -gt 0 ]] && echo "PHP test files are modified" && exit 0 |