Skip to content

Instantly share code, notes, and snippets.

@skyriser
Last active August 29, 2015 14:00
Show Gist options
  • Save skyriser/11277390 to your computer and use it in GitHub Desktop.
Save skyriser/11277390 to your computer and use it in GitHub Desktop.
structure.sql typed Rails project test with Travis CI powered by Parallel Tests (RSpec)

schema.rb を廃止して structure.sql に変更、更に parallel_tests を導入した場合の .travis.yml。(抜粋) structure.sql を直接あててるのは prepare だとなぜか入らないため。(詳しく追ってない)

language: ruby
cache: bundler
bundler_args: --without development --path vendor/bundle
before_install:
- gem install bundler --version "~> 1.5.3"
- bundle --version
before_script:
- bundle exec rake parallel:create[4]
- sed -i -e '1i SET FOREIGN_KEY_CHECKS = 0;' db/structure.sql
- mysql -uroot PROJECT_test < db/structure.sql
- mysql -uroot PROJECT_test2 < db/structure.sql
- mysql -uroot PROJECT_test3 < db/structure.sql
- mysql -uroot PROJECT_test4 < db/structure.sql
script:
- bundle exec rake parallel:spec[4]
@skyriser
Copy link
Author

bundler のバージョン指定がメッチャ古かったのでなおした。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment