Skip to content

Commit

Permalink
Fix #470
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
roschaefer committed Jun 12, 2019
1 parent fa5b16d commit 48ded03
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .travis.yml
Expand Up @@ -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
Expand All @@ -34,7 +37,10 @@ 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 unset CYPRESS_RECORD_KEY ; fi
- yarn run cypress:run
# Coverage
- codecov

Expand Down

0 comments on commit 48ded03

Please sign in to comment.