Flankでテストを爆速にする / Make your CI build faster using Flank

Flankでテストを爆速にする / Make your CI build faster using Flank

E505897a79eede1a676f92740261e8f8?s=128

Masatoshi Kubode

January 28, 2019
Tweet

Transcript

  1. ©2018 Wantedly, Inc. 'MBOLͰςετΛര଎ʹ͢Δ QPUBUPUJQT ٱอग़խढ़ 2019/01/28

  2. ©2018 Wantedly, Inc. ٱอग़խढ़ 8BOUFEMZ ओʹ8BOUFEMZ7JTJUͷ"OESPJEΞϓϦΛ։ൃ͍ͯ͠·͢ɻ J04΋൒೥΄Ͳ΍ͬͯ·ͨ͠ɻ ,PUMJO 1PLFNPO(P ࣗݾ঺հ

    5XJUUFS !TXJ[@BSE (JU)VC !LVCPEF
  3. ©2018 Wantedly, Inc.  ςετ͸*OTUSVNFOUBUJPO5FTUͷ͜ͱΛࢦ͠·͢  'JSFCBTFϢʔβʔ޲͚ͷ࿩Ͱ͢ લఏ

  4. ©2018 Wantedly, Inc.  'MBOLͱ͸  ͳͥಋೖͨ͠ͷ͔  'MBOLͷػೳ 

    ಋೖํ๏  ಋೖ݁Ռ ࿩͢͜ͱ
  5. ©2018 Wantedly, Inc. 'MBOLͱ͸

  6. ©2018 Wantedly, Inc. w 5FTU"SNBEBqBOL w 'JSFCBTF5FTU-BCΛฒྻԽ͢Δςετϥϯφʔ w "OESPJEJ04ʹରԠ w

    ಋೖ͕؆୯ w Ϩϙʔτ͕਌੾ Flankͱ͸
  7. ©2018 Wantedly, Inc. ͳͥಋೖͨ͠ͷ͔

  8. ©2018 Wantedly, Inc. w $*Ͱͷςετʹ͕͔͔͍͔࣌ؒͬͯͨΒ w #JUSJTF&MJUFͰϏϧυճʹ෼ w HDMPVEίϚϯυ 'JSFCBTF5FTU-BC

    ʹ෼ w ςετ͕߲໨͋Δ w ͔͠΋Αࣦ͘ഊ͢Δ ͳͥಋೖͨ͠ͷ͔
  9. ©2018 Wantedly, Inc. w #JUSJTFͷதͷਓ͕དྷ͍ͯͨ$*$%5FTU/JHIU Ͱ঺հ͞Ε͍ͯͨ w ͢Ͱʹ'JSFCBTF5FTU-BCΛར༻͍ͯͨ͠ w ؆୯ʹಋೖͰ͖ͦ͏

    ಋೖ·ͰͷܦҢ
  10. ©2018 Wantedly, Inc. 'MBOLͷػೳ

  11. ©2018 Wantedly, Inc. w :".-ʹΑΔઃఆͷ؅ཧ w HDMPVEެࣜͷ:".-ͱޓ׵ੑͷ͋Δهड़͕Մೳ w ࠓ·Ͱ'JSFCBTF5FTU-BCͷઃఆΛ:".-Ͱ ؅ཧ͍ͯͨ͠ͳΒมߋ఺͕গͳ͍

    Flankͷػೳ
  12. ©2018 Wantedly, Inc. w ςετͷγϟʔσΟϯά w ࢦఆͨ͠਺ʹࣗಈͰςετΛৼΓ෼͚Δ w ⚠Λࢦఆ͢ΔͱςετγϟʔυͰ࣮ߦ w

    Ϧϐʔτճ਺ͷࢦఆ w ֤γϟʔυͰඞ࣮ͣߦ͢Δςετͷࢦఆ Flankͷػೳ
  13. ©2018 Wantedly, Inc. w ֤छϨϙʔτ w ίετϨϙʔτ w ςετ݁Ռ w

    )5.- w +6OJU9.- Flankͷػೳ
  14. ©2018 Wantedly, Inc. ಋೖํ๏

  15. ©2018 Wantedly, Inc. w ฐࣾͰͷಋೖํ๏ʹ͍ͭͯܰ͘આ໌͠·͢ w Ҏલ͔Β'JSFCBTF5FTU-BCΛར༻ w GBTUMBOF w

    #JUSJTF ಋೖํ๏
  16. YAMLΛ࡞Δ ©2018 Wantedly, Inc. # flank.yml gcloud: project: XXXX type:

    instrumentation app: path/to/apk test: path/to/test/apk device: - model: Nexus6P version: 27 locale: ja_JP orientation: portrait timeout: 10m use-orchestrator: false flank: testShards: 16
  17. ©2018 Wantedly, Inc. Fastfileͷฤू # in our test lane sh("wget

    --quiet #{flank_jar_url} -O ./flank.jar") begin sh("java -jar ./flank.jar android run") ensure # Deploy test results to Bitrise if deploy_dir FileUtils.cp_r( Dir.glob("./results/**/*").select {|f| File.file?(f)}, deploy_dir ) end end ςετ݁ՌΛBitrise্Ͱ͙͢ݟΕΔ
  18. ©2018 Wantedly, Inc. w ΋ͱ΋ͱ'JSFCBTFΛಋೖ͍ͯͨ͠ͷͰɺ΄΅͜Ε ͚ͩͰࡁΜͩ w qBOLKBS͸.#΋͋ΔͷͰHJU؅ཧ͠ͳ͍ ಋೖํ๏

  19. ©2018 Wantedly, Inc. ಋೖ݁Ռ

  20. ൺֱ ©2018 Wantedly, Inc. Time Cost (Virtual device[1$/1hour]) Before(gcloud) 18min

    $0.30(Billable min: 18) Flank(shard=8, orchestrator✅) 18min $0.75(Billable min: 45) Flank(shard=8) 10min $0.33(Billable min: 20) Flank(shard=16) 7min $0.42(Billable min: 25)
  21. ϖʔδλΠτϧ ϖʔδαϒλΠτϧ ©2018 Wantedly, Inc.

  22. ©2018 Wantedly, Inc. w $*্Ͱ݁Ռ͕ݟ͑΍͘͢ͳΓςετ߲໨ͷݟ௚͠ ʹͭͳ͕ͬͨ w 'MBLZͷमਖ਼ɺະ࢖༻ίʔυͷ࡟আͳͲ w ແବͳXBJUΛݟ͚ͭ΍͘͢ͳΓमਖ਼ͯ͠ߋʹߴ଎

    Խ ෭࣍తޮՌ
  23. ©2018 Wantedly, Inc. ·ͱΊ

  24. ©2018 Wantedly, Inc. w 'MBOLʹΑͬͯςετʹ͔͔Δ͕࣌ؒେ͖͘ݮͬͨ w ςετࣗମΛݟ௚͖͔͚ͬ͢ʹͳͬͨ w ಋೖίετ΋ۚમతίετ΋ͱͯ΋༏͍͠ w

    J04ʹ΋ಋೖͰ͖ͨΒ͍ͨ͠ ·ͱΊ
  25. ϖʔδλΠτϧ ϖʔδαϒλΠτϧ ©2018 Wantedly, Inc. 5IBOLZPV

  26. ©2018 Wantedly, Inc. w ςετγϟʔυ UFTU4IBSET ͕࠷଎ w ςετ਺ ෼ͷ՝ۚൃੜ

    w ฐࣾͷ৔߹ͷݸͳΒ w ࠷ॳ͸UFTU4IBSE'MBOLͳ͠Ͱͷ࣌ؒ ෼  w ίετΛݟͭͭUFTU4IBSEݮΒͯ͠ௐ੔ ௐ੔
  27. ©2018 Wantedly, Inc. w 'MBOL • https://github.com/TestArmada/flank w 'MBOLΛ஌ͬͨεϥΠυ •

    Bitrise keynote at DeNA's CICD Test Night #2 • https://www.slideshare.net/Bitrise/bitrise-keynote-at-denas-cicd-test-night-2 Link