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

CIをもっと高速にした(かった) / ci-fast

Jun Watanabe
February 22, 2017

CIをもっと高速にした(かった) / ci-fast

Jun Watanabe

February 22, 2017
Tweet

More Decks by Jun Watanabe

Other Decks in Programming

Transcript

  1. CIΛ΋ͬͱߴ଎ʹͨ͠
    (͔ͬͨ)
    2017/02/22 PHP BLT #6
    Jun Watanabe

    View Slide

  2. Jun Watanabe
    • ORATTA, Inc. Chief Engineer
    • PHPer 8೥͘Β͍
    • ࠷ۙ͸Ϛωδϝϯτɾ։ൃ؀ڥվળͷൺॏଟΊ
    • Twitter౳: http://rela.red/
    https://recruit.oratta.net/

    View Slide

  3. CIճͯ͠·͔͢?

    View Slide

  4. ܧଓతΠϯςάϨʔγϣϯ
    • ϓϩάϥϚʔͷΞϓϦέʔγϣϯ࡞੒࣌ͷ඼
    ࣭վળ΍ೲظͷ୹ॖͷͨΊͷश׳
    • Ϗϧυ΍ςετɺΠϯεϖΫγϣϯͳͲΛܧ
    ଓతʹ࣮ߦ͍ͯ͘͜͠ͱ

    View Slide

  5. Codecov
    GitHub Flow
    scrutinizer
    pull request
    2017/02/22 ࣌఺

    View Slide

  6. Codecov
    GitHub Flow
    scrutinizer
    pull request
    2017/02/22 ࣌఺
    Ϣχοτςετ
    ΧόϨοδ

    View Slide

  7. Ϣχοτςετ
    PHP5.6.17
    PHPUnit

    View Slide

  8. 19ඵ PHPUnit΍͹͍
    >time phpunit -c phpunit.xml
    Runtime: PHP 5.6.17
    real
    0m19.066s
    user 0m14.152s
    sys 0m1.670s

    View Slide

  9. Ϣχοτςετ
    +
    ΧόϨοδϨϙʔτ
    PHP5.6.17
    PHPUnit
    Xdebug

    View Slide

  10. 14෼27ඵ Xdebug΍͹͍
    >time phpunit -c phpunit.xml —coverage-html=coverage
    Runtime: PHP 5.6.17 with Xdebug 2.3.3
    real
    14m27.768s
    user 14m2.158s
    sys 0m22.179s
    +14෼8ඵ

    View Slide

  11. PHP7ʹ͢Ε͹
    ྑ͍͡ΌΜ!

    View Slide

  12. Ϣχοτςετ
    +
    ΧόϨοδϨϙʔτ
    PHP7.1.1
    PHPUnit
    Xdebug

    View Slide

  13. 56ඵ PHP7΍͹͍
    >time phpunit -c phpunit.xml --coverage-html=coverage
    Runtime: PHP 7.1.1 with Xdebug 2.5.0
    real
    0m56.049s
    user 0m47.812s
    sys 0m1.034s
    -13෼31ඵ

    View Slide

  14. phpdbgʹ͢Ε͹
    ྑ͍͡ΌΜ!

    View Slide

  15. 5ඵ!! phpdbg΍͹͍
    >time phpdbg -qrr phpunit -c phpunit.xml --coverage-html=coverage
    Runtime: PHPDBG 7.1.1
    real
    0m05.875s
    user 0m04.711s
    sys 0m0.342s
    -51ඵ

    View Slide

  16. phpdbg
    ΋ͬͱ׆༻ͯ͠΄͍͠!

    View Slide

  17. ؆୯ʹରԠͰ͖·͢!
    • CircleCI
    • PHP7ͳΒσϑΥͰରԠ͍ͯ͠·͢!
    • homebrew-php
    • શόʔδϣϯɺΠϯετʔϧΦϓγϣϯ͕͋Γ·͢!
    • ྫ)brew install php71 --with-phpdbg

    View Slide

  18. ͱ͸͍͑ݱ࣮͸Ͳ͏ͳͷ͔
    • PHP7ʹҠߦͰ͖ͳ͍ϓϩδΣΫτ΋͋Δ
    • phpdbg͸PHP5.4͔Β࢖͑Δ
    • PHP5.5Ҏલ͸͜ͷੈ͔Β໓Μͩจ໌
    • PHP5.6ͰϑϨϯζʹͳΔํ๏Λߟ͑Δ

    View Slide

  19. CircleCIͷPHP5.6؀ڥͰ
    phpdbgΛແཧ΍Γ
    ࢖͑ΔΑ͏ʹ͠·ͨ͠

    View Slide

  20. https://github.com/
    rela1470/
    circleci-phpdbg

    View Slide

  21. phpdbgͰΧόϨοδ͕औΕΔͷ͸
    PHP7͔Βͩͬͨ
    >time phpdbg -qrr phpunit -c phpunit.xml —coverage-html=coverage
    Runtime: PHPDBG 5.6.17
    Error: No code coverage driver is available

    View Slide

  22. Ϣχοτςετ͚ͩͰ΋
    ૣ͘ͳͬͯͳ͍͔ͳ͋
    >time phpunit -c phpunit.xml
    Runtime: PHP 5.6.17
    real
    0m19.066s
    user 0m14.152s
    sys 0m1.670s

    View Slide

  23. ٯʹ8ඵ஗͘ͳͬͨ...
    >time phpdbg -qrr phpunit -c phpunit.xml
    Runtime: PHPDBG 5.6.17
    real
    0m27.769s
    user 0m23.256s
    sys 0m1.244s
    +8ඵ

    View Slide

  24. ࢖͍Έͪ͸Ξφλ࣍ୈ
    • ΋ͬͱେن໛ͳςετ؀ڥͰ࢖ͬͨΒߴ଎Խ
    ͯ͠Δͷ͔΋?
    • phpdbgͩͱ௨Βͳ͍ςετ͕͋ΔͷͰɺҠߦ
    લνΣοΫͱ͔ʹ࢖͏?

    View Slide

  25. https://github.com/
    rela1470/
    circleci-phpdbg

    View Slide

  26. forked from suzuki/its-travel-pack
    (PHPBLT #4 by @suzuki)
    https://github.com/
    rela1470/
    its-travel-pack

    View Slide