Slide 1

Slide 1 text

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

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

Slide 4

Slide 4 text

We aim to eliminate SIMPLE, REPEATED, BORING jobs.

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

1. iOS Build and Create .plist

Slide 7

Slide 7 text

2. Android Build and Test Integrated with Gerrit

Slide 8

Slide 8 text

3. “mixi” Test

Slide 9

Slide 9 text

We are (still) a Perl shop.

Slide 10

Slide 10 text

Execute Shell

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

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

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

Code Metrics •Perl::Metrics::Lite

Slide 15

Slide 15 text

% measureperl-checkstyle \ ! --max_sub_lines 60 \ ! --max_sub_mccabe_complexity 10 \ ! --directory lib/Mixi \ ! > checkstyle-result.xml

Slide 16

Slide 16 text

Code Coverage •Devel::Cover::Report::Clover

Slide 17

Slide 17 text

XML is like a violence – if it doesn’t solve your problems, you are not using enough of it.

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

Jenkins slave Jenkins master Ikachan Git repos IRC server

Slide 20

Slide 20 text

00:15-00:30

Slide 21

Slide 21 text

PROBLEM: SLOW TESTS

Slide 22

Slide 22 text

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

Slide 23

Slide 23 text

1. “recent” job

Slide 24

Slide 24 text

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

Slide 25

Slide 25 text

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

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

{ ... "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" } ] } ]

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

2. “try” job

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

% make remote-test script/devel/remote-test View test results in a web browser: http://ci.example.com/job/git-try/ %

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

ci.example.com/job/git-try/ ! buildWithParameters ? ! repos!! =!users%2Falice%2Fmixi & ! branch! =!new-feature

Slide 35

Slide 35 text

WE— HTTP

Slide 36

Slide 36 text

3. The Free Lunch

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

Summary •You can use Jenkins with Perl. •Jenkins has many “web” APIs.

Slide 39

Slide 39 text

Flickr is somewhat unique in that it uses a code repository with no branches; code.flickr.com/blog/2009/12/02/flipping-out/

Slide 40

Slide 40 text

Feature Toggle martinfowler.com/bliki/FeatureToggle.html (2010)

Slide 41

Slide 41 text

building the right it before you invest a lot of time and efforts to build it right. pretotyping.org/

Slide 42

Slide 42 text

Thanks!