From c37f35a7da390a90bd1482476976f20698e99b1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Wed, 12 Jun 2019 22:31:25 +0200 Subject: [PATCH] Fix #470 Define env variables $BRANCH and $CYPRESS_RETRIES Source: https://graysonkoonce.com/getting-the-current-branch-name-during-a-pull-request-in-travis-ci/ ------ Cypress is looking for a env var by default. See: https://docs.cypress.io/guides/guides/command-line.html#cypress-run So I guess, all what we have to do is to give the env var another name. I also added a measure to avoid running out of quota: Disable recording if dependabot just updates dependencies. --- .travis.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 42b427a11..4ca819f67 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,9 @@ install: - wait-on http://localhost:7474 script: + - export CYPRESS_RETRIES=1 + - export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi) + - echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$PR, BRANCH=$BRANCH" # Backend - docker-compose exec backend yarn run lint - docker-compose exec backend yarn run test:jest --ci --verbose=false --coverage @@ -34,7 +37,9 @@ script: - docker-compose exec webapp yarn run test --ci --verbose=false --coverage - docker-compose exec -d backend yarn run test:before:seeder # Fullstack - - CYPRESS_RETRIES=1 yarn run cypress:run + # Disable recording cypress tests if we just update dependencies. This is to + # avoid running out of quota. + - if [[ $BRANCH == *"dependabot"* ]]; then yarn run cypress:run; else yarn run cypress:run --record; fi # Coverage - codecov