Upgrade to Pro — share decks privately, control downloads, hide ads and more …

perl な web application のためのテスト情報

A3fa7c92c26f1170762202d574c19e20?s=47 soh335
September 20, 2013
2.9k

perl な web application のためのテスト情報

A3fa7c92c26f1170762202d574c19e20?s=128

soh335

September 20, 2013
Tweet

Transcript

  1. perl ͳ web application ͷͨΊ ͷςετ৘ใ yapc::asia 2013 at hiyoshi

    soh335
  2. About Me

  3. • soh335 • KAYAC inc. • ࣗࣾαʔϏε

  4. ςΩετ http://search.cpan.org/~soh/

  5. https://github.com/soh335

  6. https://github.com/soh335

  7. https://github.com/soh335

  8. http://soh335.hatenablog.com/

  9. Agenda

  10. • ςετΛॻ͍ͯ΋Β͍΍͍͢؀ڥ΁ • Ϟδϡʔϧ • db ճΓͷςετͷߴ଎Խ

  11. • perl ॻ͘ͷ׳Ε͖͚ͯͨͲɺςετ͸·͔ͩͳ͍͊ͬͯ͏ ਓɾ޻෉͍ͨ͠ͳ͍͊ͬͯ͏ਓ • perl ΍ͬͯͳ͍ਓ ର৅

  12. ࿩͞ͳ͍͜ͱ • ͜͏ TDD ͢Δͱʙʢ֓೦ʣ • ෼ࢄͯ͠ςετ͢Δͱʙʢ͍͢͝ʣ • ΞδϟΠϧ͕Ͳ͏͜͏ʢ೉͍͠ʣ •

    test Λॻ͔ͳ͍ͱͳ͍͚ͥͳ͍ͷ͔ʢͭΒ͍ʣ • ͋ͱɺϑϩϯτͷςετ
  13. Writing Tests

  14. • jenkins Λ্ख͘ճͤͯͳ͍ϓϩδΣΫτ͕͋ͬͨ • ͳΜͰ্ख͍͔͘ͳ͍ΜͩΖ͏ ?

  15. • ͕࣌ؒͳͯ͘ςετΛॻ͘Ջ͕ͳ͍ʁ • ͔΋͠Εͳ͍ʢ͜ͷεϥΠυͰ͸ѻΘͳ͍ʣ • ςετ͕ॻ͖ʹ͍͘ঢ়ଶͩͬͨ • ͜ͷεϥΠυͰ࿩͢͜ͱ ͳͥ ?

  16. • test ͕ॻ͖ʹ͍͘ঢ়ଶ • test Λॻ͘ίετ͕ߴ͍ɾख͕͔͔ؒΔɾ͕͔͔࣌ؒΔ • ΊΜͲ͍͘͞

  17. • ॻ͖΍͍͢ঢ়ଶʹͯ͋͠Ε͹ɺͱ͖ͬͭʹ͍͘ਓʹͱͬͯ ͷোน͕ݮΔ • ศརͳؔ਺΍ϞδϡʔϧΛ࢖ͬͯϨʔϧΛෑ͘ • ྑ͍ςετͱ͔ɺѱ͍ςετ͕Ͳ͏͜͏ͷલʹɺॻ͔ͳ͍ ͱ্ख͘ͳΒͳ͍

  18. t/Util.pm

  19. • ྫ͑͹ϢʔβΦϒδΣΫτ͔ΒԿ͔Λऔಘ͢Δ஋ͷςετ • t/schema/row/user__take_something.t

  20. use Test::More; use MyApp::Schema::Row::User; my $user = MyApp::Schema->user->insert({ name =>

    ...., ... => ...., ... => ...., ... => ...., ... => ...., ... => ...., }); my $something = $user->take_something; is $something, ...; done_testing; $user Λ४උ͢Δ ஋Λऔಘͯ͠ਖ਼͍͔͠ ͔֬ΊΔ
  21. • ྫ͑͹ϢʔβΦϒδΣΫτΛ༻͍ͯԿ͔Λ͢Δࡍͷςετ • t/schema/row/user__do_something.t

  22. use Test::More; use MyApp::Schema::Row::User; my $user = MyApp::Schema->user->insert({ name =>

    ...., ... => ...., ... => ...., ... => ...., ... => ...., ... => ...., }); ok $user->do_something; done_testing;
  23. VTFS@@UBLF@T PNFUIJOHU VTFS@@VQEBUF U VTFS@@EP@TP NFUIJOHU VTFS@@EJFU VTFS@@EVQMJD BUFU VTFS@@EFBE@M

    PDLU
  24. • test ͕૿͍͑ͯͬͨޙʹ user ͷ schema ͕มΘΔͱେྔͷ ςετΛॻ͖׵͑ͳ͍ͱ͍͚ͳ͍ • t/Util.pm

    ʹ create_user Έ͍ͨͳͷΛ࡞Δ
  25. package t::Util; use strict; use warnings; use parent 'Exporter'; our

    @EXPORT = qw(create_user); sub create_user { ... } 1;
  26. • t/Util.pm ʹྑ͘࢖͏ؔ਺Λ·ͱΊ͍ͯ͘ࣄͰɺΊΜͲ͘͞ ͞Λղফ͢Δ

  27. random name

  28. subtest test1 => sub { my $user = MyApp::Schema->user->insert({ name

    => "soh335", }); }; subtest test2 => sub { my $user = MyApp::Schema->user->insert({ name => "soh336", }); }; name ͕ uqniue ͩͱͯ͠ద ౰ʹ͚ͭΔ unique ΛอͭͨΊʹͪΐ ͬͱม͑Δ ...
  29. • ҙ֎ͱҰҙͳ໊લΛ͍ͪͪ͘༻ҙ͢Δͷ͕ΊΜͲ͍͘͞ • create_user ͱ͔ʹ random ʹੜ੒͢ΔΑ͏ʹ͢ΔͳͲ

  30. my $user1 = create_user(); my $user2 = create_user(); my $user3

    = create_user(); soh338 soh256 soh942
  31. ॱংʹґଘͨ͠ Test::More::subtest

  32. use Test::More; use t::Util qw(create_user) my $user = create_user(); subtest

    'foo' => sub { ok $user->do_something; }; subtest 'bar' => sub { my $something = $user->take_something; is $something, ...; }; done_testing; ̍ͭ໨ͷςετΛॻ͘ ̎ͭ໨ͷςετΛॻ͘
  33. my $user = create_user(); subtest 'foo' => sub { ok

    $user->do_something; }; subtest 'bar' => sub { my $something = $user->take_something; is $something, ...; }; subtest 'baz' => sub { ok $user->update_something; }; baz Λ௥Ճ user ͷঢ়ଶ͕ͲΜͲ ΜมΘΔ ࠷ॳͷ subtest Λमਖ਼͢Δͱ શ෦मਖ਼͢Δඞ༻͕ग़Δ͔΋͠Ε ͳ͍
  34. • subtest Ͱ͍ͬͯ͘͘͘ͷ͕ѱ͍͜ͱͰ͸ͳ͍ • top level ͰΦϒδΣΫτΛڞ༗͢Δͱ͋Γ͕ͪ • Test::Class •

    http://shibayu36.hatenablog.com/entry/2013/07/16/231144
  35. • ڊେͳҰຕͳ test Λॻ͔ͳ͍ • t/schema/row/user/01_take_something.t • t/schema/row/user/02_do_update.t • t/schema/row/user__take_something.t

    • t/schema/row/user__do_update.t • ͱ͔Ͱ෼͚ͯΔ
  36. ࣌ؒճΓͷςετ Test::MockTime

  37. • ͜ͷظ͔ؒΒɺ͜ͷظؒ·ͰڍಈΛม͍͑ͨͱ͔ɺweb application ͩͱ͋Γ͕ͪɻ • perl ͳΒ time() ͷڍಈΛม͑ΒΕΔ

  38. use Test::MockTime; use Time::Piece; ઌʹ Test::MockTime ΛಡΈ ࠐ·ͳ͍ͱͩΊ

  39. ࣌ؒΛࢭΊΔ ಈ͖ग़͢... use Test::MockTime (:all); set_fixed_time('2013-01-01T00:00:00Z'); # 2013-01-01 00:00:00 time()

    ...; restore_time(); 2013 - 01 - 01 00:00:00
  40. use Test::TimBlock; timeblock { # set_fixed_time('2013-01-01 00:00:00', '%Y-%m-%d %H:%i:%s +0900');

    set_time "2013-01-01 00:00:00"; ... }; # <- restore_time scope Λൈ͚Δͱ restore_time() ΛݺͿΑ͏ͳ wrapper Λ project ༻ʹ࡞ͬͨΓͯ͠Δ set_fixed_time( '2013-01-01 00:00:00', '%Y-%m-%d %H:%i:%s +0900' );
  41. # set_fixed_time('2013-01-01 00:00:00', '%Y-%m-%d %H:%i:%s +0900'); set_fixed_time '2013-01-01 00:00:00' =>

    sub { ... }; # <- restore_time scope Λൈ͚Δͱ restore_time() ͕ݺ͹ΕΔ Test::TimeMock::set_fixed_time ʹ sub {} Λ౉ͤΔΑ͏ʹ͢Δ
  42. DataStore

  43. Test::mysqld mysqld runner for tests

  44. • ͍͍ͩͨͷ web application ͩͬͨΒ db ͕෇͖వ͏ • temporary ͳ

    mysqld process ΛͨͯͯɺͦΕΛςετʹ࢖ ͏ • MyApp::Test ͱ͔ t::Util ͱ͔Ͱ db ͷܨ͙ઌΛ test::mysqld ʹ ্ॻ͖͢Δ
  45. UFTUNZTRME EBUBCBTFU NZTRME test ͷ͚࣌ͩॻ͖׵͑Δ

  46. package MyApp::Test; use Test::mysqld; our $mysqld; sub import { my

    $class = shift; { $mysqld = Test::mysqld->new( my_cnf => { 'skip-networking' => '', } ); MyApp->config->{ dbi } = [ $mysqld->dsn( dbname => 'test' ) ]; } } 1; ෼͔Γ΍͘͢ྫ͑Δͱ MyApp::Test ͕ use ͞ΕΔͱ dbi ͷ ઃఆΛॻ͖׵͑Δ
  47. • Test::mysqld ͷηοτΞοϓʹ͸͋Δఔ౓ίετ͕͔͔Δͷ Ͱ࣮ࡍʹ db ΛಡΈࠐΉͱ͜ΖͰઃఆͷ্ॻ͖Λ͢ΔΑ͏ ʹͨ͠Γ͢Δ • खݩͳΒ mysqld

    ্ཱͪ͛ͬͺͳ͠ͰͦΕΛ࢖͏ͱ͔΋͋ Γ
  48. Test::RedisServer redis-server runner for tests

  49. package MyApp::Test; use Test::RedisServer; our $redis_server; sub import { my

    $class = shift; { $redis_server = Test::RedisServer->new; MyApp->config->{ redis } = $redis_server->connect_info; } } 1;
  50. use utf8;

  51. • use utf8; ͳ͍ͱ͖ʹΑ͘Θ͔Βͳ͍ײ͡ͰϋϚΔͱΊΜͲ ͏ • use utf8 ͕ͳ͍ϑΝΠϧ͕͋Δͱςετ͕௨Βͳ͍

  52. Plack ճΓ

  53. Plack::Test Test PSGI applications with various backends

  54. use Plack::Test; test_psgi app => sub { my $env =

    shift; return [ 200, [ 'Content-Type' => 'text/plain' ], [ "Hello World" ] ], }, client => sub { my $cb = shift; my $req = HTTP::Request->new(GET => "http://localhost/hello"); my $res = $cb->($req); like $res->content, qr/Hello World/; }; from Plack::Test synopsis app ʹ request
  55. my $app = MyApp->new test_psgi( app => $app->handler, client =>

    sub { my $cb = shift; my $req = GET 'http://localhost/hello'; my $res = $cb->($req); like $res->content, qr/Hello World/; } ); ࣮ࡍʹ͸ MyApp ͱ ͔͔Β app ͱͳΔͱ͜Ζ Λ౉͢
  56. use MyApp::Test; my $req = GET 'http://localhost/hello'; my $res =

    request_to_app( $req ); like $res->content, qr/Hello World/; MyApp::Test ͱ͔Ͱָʹग़དྷΔ ͷ΋Α͍Ͱ͢Ͷ͐ HTTP::Cookie ࢖ͬͯ cookie ΋ ѻ͑ΔΑ͏ʹͨ͠Γ͢Δ
  57. Test::WWW::Mechanize ::PSGI Test PSGI programs using WWW::Mechanize

  58. my $app = MyApp->new; my $mech = Test::WWW::Mechanize::PSGI->new( app =>

    $app->handler ); $mech->get('/hello'); ok $mech->content_like(qr/Hello World/); mechanize ͷ interface Λ࢖ ͬͯςετ͕ग़དྷΔ
  59. • ݸਓతʹ͸ api ͷςετΛॻ͘͜ͱͷํ͕ࠓ͸ଟ͍ͷͰ Test::PSGI + α Ͱ଍ΓͯΔ

  60. Testing Batch and Script

  61. • ఆظత or Կ͔໰୊͕͋ͬͯ batch script ͷΑ͏ͳ΋ͷ͸Α ͘ॻ͘ • ఆظతʹ࢖͏΋ͷ͸ͪΌΜͱςετ͞Ε͍ͨ

    • ໰୊͕͋ͬͯमਖ਼͢ΔΑ͏ͳ৔߹͸ͪΌΜͱಈ࡞Λอো͠ ͍ͨ • όονͷ࣮ߦΛ package ʹ֎ग़͢͠Δ
  62. TDSJQUEP@TPNFUIJOHU TDSJQUCBUDIQM .Z"QQ#BUDI4PNFU IJOH ҰຕͰશ෦΍ͬ ͯ͘ΕΔ script ෼͚Δ ίϚϯυϥΠϯ͔Β ϞδϡʔϧΛݺͿ

    ॲཧຊମ
  63. use Class::Load qw(load_class); use FindBin::libs; my $name = shift @ARGV;

    my $module = "MyApp::Batch::$name"; load_class($module); $module->new_with_options->run; ίϚϯυϥΠϯ͔Β౉͞Εͨจ ࣈྻ͔Β class Λ new ͯ͠ run method ΛݺͿ perl script/batch.pl Something --go
  64. package MyApp::Batch::Something; use Mouse; with 'MouseX::Getopt'; has go => (

    is => 'ro', isa => 'Bool', default => sub { 0 } ); no Mouse; sub run { .... } 1; Mo[ou]seX::Getopt ͰίϚϯυϥΠϯͷ Ҿ਺Λ attribute ʹ͋ͯΔ
  65. ࣮ߦલͷঢ়ଶͷςετ ࣮ߦޙͷঢ়ଶͷςετ use Test::More; use MyApp::Batch::Something; # before testing MyApp::Batch::Something->new(

    go => 0 )->run; # after testing done_testing;
  66. Testing Cache

  67. NPEVMF NZTRM DBDIF ॳճͷΞΫηε͸ mysql ʹΞΫηε͢Δ ೋ౓໨͔Β͸ mysql ʹ͸ ΞΫηε͕ͳ͍

  68. package t::Util; sub trace_sql (&) { my $sub = shift;

    my @sqls; require DBIx::QueryLog; my $g = DBIx::QueryLog->guard; local $DBIx::QueryLog::OUTPUT = sub { my %params = @_; push @sqls, $params{sql}; }; $sub->(); @sqls; } 1; ͜ͷ scope ͚ͩ query Λऔ ಘ͢Δ
  69. { my @sqls = trace_sql { $user->do_heavy_something; }; is scalar

    @sqls, 10; } { my @sqls = trace_sql { $user->do_heavy_something; }; is scalar @sqls, 0; # cache ! } 10 ճ query ͕ྲྀΕ͍ͯΔ ̍ճ΋ query ͕ྲྀΕ͍ͯͳ͍
  70. Testing for not engineer

  71. 01.jpg 02.jpg 03.jpg august 01.jpg 02.jpg 03.jpg september ຖ݄ߋ৽͢Δ͚Ͳը૾ ͷ໋໊نଇ͸ಉ͡

    σΟϨΫτϦͱਖ਼͍͠ը ૾͕͋Δ͔Λςετ͢Δ
  72. ZBQDIUNM ΍ʔͽͬ͘

  73. • ը૾ͷ໋໊نଇ • ฆΒΘ͍͠จݴ • master data

  74. • ͜Μͳײ͡Ͱ৭ʑ༻ҙ͢Δͱςετʹ׳Εͯͳ͍ਓͰ΋޾ ͤʹͳΕΔ • ٳܜ..........

  75. Test CPAN Module

  76. Test::Deep Extremely flexible deep comparison

  77. is_deeply( $user, { name => "foo" relation_users => ["bar", "baz",

    "yap"], map => { 1 => "hoge", 10 => "fuga", 100 => "piyo", }, }, ); hash ͱ͔ array ͕ܾ·ͬͨύλʔϯ͡ Όͳ͘୔ࢁ͋Δͱ is_deeply ͩͱͩΔ͍࣌ ͕͋Δ
  78. cmp_deeply( $user, { name => "foo" relation_users => bag("baz", "yap",

    "bar"), map => { 1 => "hoge", 10 => "fuga", 100 => "piyo", }, }, ); Test::Deep ͔Β export ͞ΕΔ ॱং͸อোͤͣʹ಺༰͸શ෦ ͋Δ͜ͱΛςετ͢Δ ॱং͸อোͤͣʹ಺༰͸શ෦ ͋Δ͜ͱΛςετ͢Δ
  79. cmp_deeply( $user, { name => "foo" relation_users => bag("baz", "yap",

    "bar"), map => superhashof({ 1 => "hoge", 10 => "fuga", }), }, ); hash ͷҰ෦ͷ key ͚ͩςετग़ དྷΕ͹ྑ͍
  80. cmp_deeply( $user, { name => ignore(), relation_users => bag("baz", "yap",

    "bar"), map => superhashof({ 1 => "hoge", 10 => "fuga", }), }, ); hash ͷ key ͷଘࡏ͚ͩςετ ͠ɺ஋͸ԿͰ΋ྑ͍
  81. Test::Deep::JSON Compare JSON with Test::Deep

  82. cmp_deeply( $res->content, json({ name => ignore(), relation_users => bag("baz", "yap",

    "bar"), map => superhashof({ 1 => "hoge", 10 => "fuga", }), }), ); json ʹ decode ͯ͘͠Ε Δ
  83. Test::Deep::Matcher Type check matchers for Test::Deep

  84. cmp_deeply( $res->content, json({ name => ignore(), relation_users => bag("baz", "yap",

    "bar"), map => superhashof({ 1 => is_string, 10 => "fuga", }), }), ); is_* Ͱ ignore ΑΓܕͰݫ͠໨ʹν ΣοΫग़དྷΔ
  85. Test::Deep::Cond simple code test in Test::Deep

  86. cmp_deeply( $res->content, json({ name => ignore(), relation_users => is_array_ref &&

    cond { scalar @$_ == 3 }, map => superhashof({ 1 => is_string, 10 => "fuga", }), }), ); ͪΐͬͱͨ͠ࣄʹ plugin ͱ͔࡞Γ ͨ͘ͳ͍ͳʔͬͯ࣌ʹ $_ ʹ test ͞ΕΔ ஋Λ͍Εͯ͘ΕΔɻ 2 <= $_ and < 5 ͱ͔ɻ
  87. • superhashof ͱ͔͸ಛʹෳࡶͳ json Λฦ͢Α͏ͷςετͰ ͸ศར͚ͩͲɺ΍Γ͗͢Δͱɺຊ౰͸ςετ͕ඞ༻ͳ΋ͷ ͕লུ͞ΕͨΓͯ͠ؾ͔ͮͳ͍͔Β஫ҙɻ

  88. Test::MockTime Replaces actual time with simulated time

  89. • ͖ͬ͞આ໌ͨ͠ͷͰඈ͹͠

  90. Test::Exception Test exception based code

  91. use Test::Exception; throws_ok { $user->do_something; } qr(user is died because

    ...), 'expect to die'; ͪΌΜͱྫ֎Λ౤͛ͯɺ͔ͭͦͷจ ݴΛςετ
  92. Test::Fatal incredibly simple helpers for testing code with exceptions

  93. use Test::Fatal; like( exception { $user->do_something }, qr(user is died

    because ...), "expect to die", ); Test::Exception ΑΓί ʔυ͕ simple
  94. Test::Mock::Guard Simple mock test library using RAII

  95. None
  96. • ͱ͍͏࿩͸ஔ͍͓͍ͯͯ

  97. Test::Output Utilities to test STDOUT and STDERR messages

  98. stderr_is( $user->depcateded_method(), "this method is deplicated !" ); stdout_is, stdout_like

    ͱ ͔΋͋Δ ྫ͑͹ deplicated ͳ method ͕ݺ͹ΕͨΒ warn ͢Δ͚Ͳɺ৚ ͕݅ෳࡶ͔ͩΒͪΌΜͱݺ͹ΕΔ͔ςετ ͓͖͍ͯͨ͠
  99. my $buffer = ''; open my $fh, '>', \$buffer or

    die $!; local *$STDERR = $fh; $user->depcateded_method(); is $buffer, 'this method is deplicated !'; ݸਓతʹ͸͜ΕͰࣄ଍ΓΔ ͔ͳ͊...
  100. use Test::Mock::Guard qw(mock_guard); my $guard = mock_guard( 'MyApp::Schema::Row::User', { 'take_something'

    => sub { return +{ foo => 1, bar => 2, } }, } ); is_deeply( $user->take_something, { foo => 1, bar => 2, } ); is $guard->call_count( 'MyApp::Schema::Row::User', 'take_something' ), 1; $guard ͕ scope ͷதͰଘ ࡏ͢Δ͚࣌ͩϝιουͷڍಈ Λࠩ͠ସ͑Δ ݺ͹Εͨճ਺Λς ετ
  101. http mock

  102. • Test::Mock::LWP • Test::Mock::LWP::Conditional • Test::Mock::Furl

  103. • ruby ͷ webmock • https://github.com/bblimke/webmock • ֎ʹग़Α͏ͱͨ͠Β die •

    url ͚ͩ͡Όͳͯ͘ parameter, content, header ͕͋Θͳ͔ ͬͨΒ die
  104. • Test::Mock::Furl::Constraint • https://github.com/soh335/Test-Mock-Furl-Constraint

  105. speed up test with db

  106. • web application, db ͷςετ͕ଟͯ͘ɺςετ͕૿͑Ε͹૿ ͑Δ΄Ͳ஗͘ͳΔ • ࠷ऴతʹ͸෼ࢄͱ͔ͯ͠.... ʹͳΔͷ͔΋͠Εͳ͍͚Ͳɺݸ ਓతʹ͸ͦͷྖҬ·Ͱߦͬͯͳ͍ͷͰ͜͜Ͱ͸ѻΘͳ͍Ͱ

    ͢
  107. • prove -j • ฒྻ࣮ߦ • ฒྻ࣮ߦͯ͠΋େৎ෉Α͏ͳςετΛॻ͘ • ϑΝΠϧͱ͔͸ File::Temp

    ࢖ͬͨΓ... • Test::Synchronized ͍ͬͯ͏ͷ΋͋Δ͚Ͳ ....
  108. JNBHF@XSJUFU JNBHF@VQEBUFU JNBHF@EFMFUFU UFTUKQFH ྫ͑͹ը૾ͷ test Ͱ֤ test Ͱಉ໊͡લͰૢ࡞͢ΔͱฒྻͰ ςετͨ࣌͠ʹ͓͔͘͠ͳΔ

    use File::Temp !
  109. • Test::mysqld ͷ্ཱͪ͛ʹ͕͔͔࣌ؒΔ • Ͳ͜ʹ͕͔͔͍࣌ؒͬͯΔ͔ௐ΂Δ

  110. 5FTUNZTRME TDIFNB NBTUFS EBUB NZTRME mysqld ͷ্ཱͪ͛ʹ ͕͔͔࣌ؒΔ schema, master

    data Λ͍ΕΔͷʹ࣌ؒ ͕͔͔Δ
  111. • schema Λ࡞ͬͨΓ data Λྲྀ͜͠Ήॴ • ඞ༻ͳσʔλ͚ͩΛಡΈࠐΉΑ͏ʹ͢Δ • ͦΕ͸ͦΕͰΊΜͲ͍͘͞ •

    σʔλ͕શͯἧͬͯΔঢ়ଶͰςετ͍ͨ͠ؾ࣋ͪ
  112. • ઌʹηοτΞοϓࡁΈͷςετ༻ mysqld Λ༻ҙͯ͠͠·͏ • શͯͷςετ͕૸Δ࠷ॳʹ temporary ͳ mysqld Λ࡞Γɺ

    schema ΍ data Λ༻ҙ͢Δ • ֤ςετͰ db ͕ඞ༻ͳ৔߹͸͔ͦ͜Β copy Λ͠ɺmy.cnf ͳͲΛॻ͖׵͑ͯىಈ͢Δ
  113. @VTFSU @VTFSU @VTFSU @VTFSU PSJHJOBM UFTUNZTRME @VTFSU DPQZ UFTUNZTRME prove

    ։࢝࣌ʹ schema, master data ͕ೖ ͬͯΔ original test::mysqld Λ࡞Δ ֤ςετϑΝΠϧͰ ͸ original test::mysqld ͔Β copy ͠ɺmy.cnf Λमਖ਼͠ى ಈ͢Δ schema, master data Λ༻ҙ ͢ΔίετΛԼ͛ͨ
  114. • Test::mysqld::copy_data_from (0.17)

  115. • copy ͠·ͬͯ͘Δͱ io ͕ࢮ͵ • copy ճΓͷ΍ΓͱΓΛ tmpfs Ͱ΍Δ

  116. • mysqld Λ্ཱͪ͛Δࣗମʹίετ͕͔͔Δ • App::Prove::Plugin::MySQLPool • https://github.com/mash/App-Prove-Plugin-MySQLPool

  117. @VTFSU @VTFSU @VTFSU @VTFSU UFTUNZTRME @VTFSU UFTUNZTRME UFTUNZTRME UFTUNZTRME test::mysqld

    Λฒྻ ෼ ্ཱͪ͛Δ ্ཱ͕ͪͬͯΔ mysql ͔Β࢖͑Δ΋ͷ͕ ׂΓ౰ͯΒΕΔ mysqld ͷ্ཱͪ͛ ͷίετ͕͔͔Βͳ͘ ͳΔ
  118. • -j ͗ͯ͢͠ cpu ͕ͭΒ͍ • cpu ࢖͍͖ͬͪΌ͏ͱεϖοΫ͋͛Δ͔෼ࢄ͢Δ͔ ....

  119. • ͦΜͳ͋ͳͨʹɺ໌೔ͷ 15:40 ͔Βͷ myfinder ͞Μͷ ϑϧςετ΋50msͰऴΘΒ͍ͤͨ ʙ FreakOutͷऔΓ૊ Έ

    ʙ ຊ౰ͷߴ଎ԽΛݟͤͯ ͘ΕΔͬͯ HUB Ͱݴͬͯ·͠ ͨ !!!!
  120. let’s testing !