20. Launch mysql server on docker
dockerのインストール後
$ docker run -d -p 55001:3306
-e MYSQL_ROOT_PASSWORD=password mysql
これだけでmysqlサーバが起動する
20
21. dockerのインストール後
$ docker run -d -p 55001:3306
-e MYSQL_ROOT_PASSWORD=password mysql
これだけでmysqlサーバが起動する
Launch mysql server on docker
21
dockerの外向けのポート コンテナ内部のポート
実行時に設定する環境変数 起動するコンテナの
イメージ名
24. Test with middleware for MAGELLAN
MAGELLANは大量のトランザクションを安定
的に捌く必要があるため、分散DBや分散キュー
などのミドルウェアを利用する。
MAGELLANの単体テストは、各開発者のPCと
CIサーバの環境で実行されるので、各環境でミ
ドルウェアをどう扱うのかが重要。
24
36. Example to get connection configuration
Mcrain::Mysql.new.start do ¦server¦
args = server.client_init_args
#=> [{host: 192.168.99.100 , port: 55001, username: root }]
c = Mysql2::Client.new(*args)
・・・
end
36
37. Example to get client
Mcrain::Mysql.new.start do ¦server¦
c = server.client
c.query("CREATE DATABASE foo )
c.select_db("foo )
c.query("CREATE TABLE bar (…); )
end
37
38. Example to launch 2 mysql daemons
Mcrain::Mysql.new.start do ¦server1¦
Mcrain::Mysql.new.start do ¦server2¦
・・・
end
end
38
44. parallel_tests
Speedup Test::Unit + RSpec + Cucumber
+ Spinach by running parallel on multiple
CPU cores.
ParallelTests splits tests into even groups
(by number of lines or runtime) and runs
each group in a single process with its
own database.
44
https://github.com/grosser/parallel_tests