How we use Jenkins at mixi

How we use Jenkins at mixi

7828b45f8396aa361d85cead01fd99ca?s=128

Kazuyoshi Kato

February 22, 2012
Tweet

Transcript

  1. How we use Jenkins at mixi Kato Kazuyoshi mixi, Inc.

  2. Kato Kazuyoshi 2012.8-p.info/ You can see my name on Firefox,

    jQuery UI, Scala.
  3. </officiallanguage>

  4. We aim to eliminate SIMPLE, REPEATED, BORING jobs.

  5. None
  6. 1. iOS Build and Create .plist

  7. 2. Android Build and Test Integrated with Gerrit

  8. 3. “mixi” Test

  9. We are (still) a Perl shop.

  10. Execute Shell

  11. Test Results •TAP::Harness::JUnit •tap-to-junit-xml

  12. % prove --harness TAP::Harness::JUnit ...

  13. None
  14. Code Metrics •Perl::Metrics::Lite

  15. % measureperl-checkstyle \ ! --max_sub_lines 60 \ ! --max_sub_mccabe_complexity 10

    \ ! --directory lib/Mixi \ ! > checkstyle-result.xml
  16. Code Coverage •Devel::Cover::Report::Clover

  17. XML is like a violence – if it doesn’t solve

    your problems, you are not using enough of it.
  18. None
  19. Jenkins slave Jenkins master Ikachan Git repos IRC server

  20. 00:15-00:30

  21. PROBLEM: SLOW TESTS

  22. Small Medium Large Network access No localhost only Yes Database

    No Yes Yes File system access No Yes Yes Use external systems No Discouraged Yes Multiple threads No Yes Yes Sleep statements No Yes Yes System properties No Yes Yes Time limit (seconds) 60 300 900+ googletesting.blogspot.com/2010/12/test-sizes.html
  23. 1. “recent” job

  24. lib/Mixi/Foo.pm t/lib/Mixi/Foo.t t/lib/Mixi/Foo/bar.t t/lib/Mixi/Foo/baz.t

  25. ci.example.com/job/trunk-recent/5446/api/json

  26. ci.example.com/job/trunk-recent/5446/api/json $BUILD_URL

  27. { ... "changeSet" : { "kind" : null, "items" :

    [ { "msg" : "...", "comment" : "...", "date" : "2012-02-21 10:07:29 +0000", "id" : "f9b10e71011cb33f90ef6092e72fab4947e3350f", "author" : { ... }, "paths" : [ { "file" : "static/js/mixi/notify/visitor-min.js", "editType" : "edit" }, { "file" : "static/js/mixi/notify/visitor.js", "editType" : "edit" } ] }, { "msg" : "...", "comment" : "...", "date" : "2012-02-21 10:11:06 +0000", "id" : "7289c319218d3f9e3d64b2a3a58333a3735ed2b5", "author" : { ... } "paths" : [ { "file" : "script/change_order_image.pl", "editType" : "edit" } ] } ]
  28. None
  29. 2. “try” job

  30. None
  31. % make remote-test script/devel/remote-test View test results in a web

    browser: http://ci.example.com/job/git-try/ %
  32. None
  33. None
  34. ci.example.com/job/git-try/ ! buildWithParameters ? ! repos!! =!users%2Falice%2Fmixi & ! branch!

    =!new-feature
  35. WE— HTTP

  36. 3. The Free Lunch

  37. None
  38. Summary •You can use Jenkins with Perl. •Jenkins has many

    “web” APIs.
  39. Flickr is somewhat unique in that it uses a code

    repository with no branches; code.flickr.com/blog/2009/12/02/flipping-out/
  40. Feature Toggle martinfowler.com/bliki/FeatureToggle.html (2010)

  41. building the right it before you invest a lot of

    time and efforts to build it right. pretotyping.org/
  42. Thanks!