Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
fix(travis): start rails server in before_script
Browse files Browse the repository at this point in the history
  • Loading branch information
tomchentw committed Jan 12, 2014
1 parent 518a16e commit c7c1783
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ before_install:
- cd misc/test-scenario
- export BUNDLE_GEMFILE=$PWD/Gemfile
- bundle install
- RAILS_ENV=test bundle exec rake db:drop db:migrate
- rails s -d -e test -p 2999
- cd ../..
- export BUNDLE_GEMFILE=$PWD/Gemfile
before_script:
- npm install --quiet -g gulp karma protractor
- npm install --quiet
script: npm test
after_script:
- sudo kill `cat misc/test-scenario/tmp/pids/server.pid`
- kill $(lsof -i :2999 -t)
addons:
sauce_connect: true
env:
Expand Down
18 changes: 14 additions & 4 deletions gulpfile.ls
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,22 @@ gulp.task 'karma' <[ build ]> ->
.pipe gulp-exec('karma start misc/karma.conf.js')

gulp.task 'protractor' <[ build ]> ->
return gulp.src 'src/angular-ujs.scenario.ls'
stream = gulp.src 'src/angular-ujs.scenario.ls'
.pipe gulp-livescript!
.pipe gulp.dest 'tmp/'
.pipe gulp-exec('cd misc/test-scenario && bundle && (RAILS_ENV=test rake db:drop db:migrate) && rails s -d -e test -p 2999 && cd ../..')
.pipe gulp-exec('protractor misc/protractor.conf.js')
.pipe gulp-exec('kill $(lsof -i :2999 -t)')

stream = stream.pipe gulp-exec [
'cd misc/test-scenario'
'bundle install'
'RAILS_ENV=test rake db:drop db:migrate'
'rails s -d -e test -p 2999'
'cd ../..'
].join ' && ' unless process.env.TRAVIS

stream = stream.pipe gulp-exec('protractor misc/protractor.conf.js')
stream = stream.pipe gulp-exec('kill $(lsof -i :2999 -t)') unless process.env.TRAVIS

return stream

gulp.task 'bump' ->
return gulp.src 'package.json'
Expand Down

0 comments on commit c7c1783

Please sign in to comment.