Skip to content

Commit

Permalink
[travis] run integration tests only for pushes
Browse files Browse the repository at this point in the history
  • Loading branch information
dunn committed Sep 2, 2016
1 parent 0a46253 commit 39b3031
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 18 deletions.
23 changes: 5 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,22 @@ env:
- secure: 'y+crCYO9hfMVE8PYe3hTpxsLQzg0zc4AWPyUClmdHUA+VvH3pPw7gtJNpO+D51IrR82pDMBrDcUH1KaEcAsN2rKDG5yLbwrt7/n2nnzFfnvUY0tA/MyR+gcu/lrjNid8VpttW5C0GF2BPkzRSy+MKfa47Iodu7OTndr3ie8KRJpjJ+R8AnSU+wIRyCe+aE5ttMHKEx7TC3ItjtGrUuwZL0lJv0OBYenRzU1QhZBR5+0Wh0yHpOdHcwhQGuutjyYC1g4iDEBygBUTWK69nEIFknUv46gAAOXk53cj9IFTeMhnUL/SFepelxMVI8Z5YrzFS0S6hQp8zliO5iv6f1H0xT6V2plngBKLP+ZzUkJdzAU1RB2Ukj3VBsEAR3PZir9nVnf+OxZhmDqiaI1uaDtCWOGA4tzeYa6jtbbrOY/7ouTCzxCHJwZia7rpH4cIHTgluVypm9wMxMcxdEB0noowEnn2miaQYB/4/FP5KNnqMC7mjT/RXDQd3LTgospLMmZDDPC26lnW841pAEA/RjbdDOhlBrN4IDSP7Jv4gYXhSHwuxEzH26LciWy/4AKz/tuQhw3Gzw3epHBYUo3iH/GQ02OTSTXmJ5Dyuv3PfZYCe0nY0J4p8yEM8otGX3qd9nAKYjEnnXta6AvSZr5nL99MHQzLtEySYsr/mPFC2SEjSMw='

before_install:
- sudo install -o "$USER" -d /etc/blocktogether
- sudo install -o "$USER" -d /data/blocktogether
- cp -a config/* /etc/blocktogether/
- sed "s/XXXXXXXXXXXXXXXXXXXXXXXXX/$CONSUMER_KEY/" config/production.json > /etc/blocktogether/config.json
- sed -i "s/YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY/$CONSUMER_SECRET/" /etc/blocktogether/config.json
# turn off secureProxy
- sed -i 's/true/false/' /etc/blocktogether/config.json
# use local callback
- sed -i 's|https://blocktogether.org/auth/twitter/callback|http://localhost:2078/auth/twitter/callback|' /etc/blocktogether/config.json
- mysqladmin -u root password "$DB_ROOT_PASS"
- sudo bin/setup.sh
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then sudo bin/travis/before_install.sh; fi

install:
- wget https://dl.google.com/closure-compiler/compiler-latest.zip
- unzip -n compiler-latest.zip
- npm install
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then npm install; fi

before_script:
- node_modules/.bin/sequelize --config /etc/blocktogether/sequelize.json db:migrate
- ./run-dev.sh > bt.log 2>&1 &
- sleep 10
- curl -IL http://localhost:2078
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then bin/travis/before_script.sh; fi

script:
# TODO: Enable checkTypes after adding more types to externs.js
- "cat *.js | java -jar closure-compiler-*.jar --language_in=ECMASCRIPT6 --warning_level=VERBOSE --jscomp_off=checkTypes
--externs=externs/externs.js --externs=externs/core.js --externs=externs/process.js
--externs=externs/underscore-1.5.1.js > /dev/null"
- npm test
- if [ "$TRAVIS_PULL_REQUEST" = "false" ];; then npm test; fi

after_failure:
- cat bt.log
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then cat bt.log; fi
14 changes: 14 additions & 0 deletions bin/travis/before_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

sudo install -o "$USER" -d /etc/blocktogether
sudo install -o "$USER" -d /data/blocktogether
cp -a "$(dirname ${BASH_SOURCE[0]})/../../"config/* /etc/blocktogether/
sed "s/XXXXXXXXXXXXXXXXXXXXXXXXX/$CONSUMER_KEY/" \
"$(dirname ${BASH_SOURCE[0]})/../../"config/production.json > /etc/blocktogether/config.json
sed -i "s/YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY/$CONSUMER_SECRET/" /etc/blocktogether/config.json
# turn off secureProxy
sed -i 's/true/false/' /etc/blocktogether/config.json
# use local callback
sed -i 's|https://blocktogether.org/auth/twitter/callback|http://localhost:2078/auth/twitter/callback|' /etc/blocktogether/config.json
mysqladmin -u root password "$DB_ROOT_PASS"
sudo "$(dirname ${BASH_SOURCE[0]})/../setup.sh"
8 changes: 8 additions & 0 deletions bin/travis/before_script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

"$(dirname ${BASH_SOURCE[0]})/../../node_modules/.bin/sequelize" \
--config /etc/blocktogether/sequelize.json db:migrate
"$(dirname ${BASH_SOURCE[0]})/../../run-dev.sh" \
> "$(dirname ${BASH_SOURCE[0]})/../../bt.log" 2>&1 &
sleep 10
curl -IL http://localhost:2078

0 comments on commit 39b3031

Please sign in to comment.