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

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

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

Masatoshi Kubode

January 28, 2019
Tweet

More Decks by Masatoshi Kubode

Other Decks in Technology

Transcript

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

    View full-size slide

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

    View full-size slide

  3. ©2018 Wantedly, Inc.
    ςετ͸*OTUSVNFOUBUJPO5FTUͷ͜ͱΛࢦ͠·͢
    'JSFCBTFϢʔβʔ޲͚ͷ࿩Ͱ͢
    લఏ

    View full-size slide

  4. ©2018 Wantedly, Inc.
    'MBOLͱ͸
    ͳͥಋೖͨ͠ͷ͔
    'MBOLͷػೳ
    ಋೖํ๏
    ಋೖ݁Ռ
    ࿩͢͜ͱ

    View full-size slide

  5. ©2018 Wantedly, Inc.
    'MBOLͱ͸

    View full-size slide

  6. ©2018 Wantedly, Inc.
    w 5FTU"SNBEBqBOL
    w 'JSFCBTF5FTU-BCΛฒྻԽ͢Δςετϥϯφʔ
    w "OESPJEJ04ʹରԠ
    w ಋೖ͕؆୯
    w Ϩϙʔτ͕਌੾
    Flankͱ͸

    View full-size slide

  7. ©2018 Wantedly, Inc.
    ͳͥಋೖͨ͠ͷ͔

    View full-size slide

  8. ©2018 Wantedly, Inc.
    w $*Ͱͷςετʹ͕͔͔͍͔࣌ؒͬͯͨΒ
    w #JUSJTF&MJUFͰϏϧυճʹ෼
    w HDMPVEίϚϯυ 'JSFCBTF5FTU-BC
    ʹ෼
    w ςετ͕߲໨͋Δ
    w ͔͠΋Αࣦ͘ഊ͢Δ
    ͳͥಋೖͨ͠ͷ͔

    View full-size slide

  9. ©2018 Wantedly, Inc.
    w #JUSJTFͷதͷਓ͕དྷ͍ͯͨ$*$%5FTU/JHIU
    Ͱ঺հ͞Ε͍ͯͨ
    w ͢Ͱʹ'JSFCBTF5FTU-BCΛར༻͍ͯͨ͠
    w ؆୯ʹಋೖͰ͖ͦ͏
    ಋೖ·ͰͷܦҢ

    View full-size slide

  10. ©2018 Wantedly, Inc.
    'MBOLͷػೳ

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  13. ©2018 Wantedly, Inc.
    w ֤छϨϙʔτ
    w ίετϨϙʔτ
    w ςετ݁Ռ
    w )5.-
    w +6OJU9.-
    Flankͷػೳ

    View full-size slide

  14. ©2018 Wantedly, Inc.
    ಋೖํ๏

    View full-size slide

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

    View full-size slide

  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

    View full-size slide

  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্Ͱ͙͢ݟΕΔ

    View full-size slide

  18. ©2018 Wantedly, Inc.
    w ΋ͱ΋ͱ'JSFCBTFΛಋೖ͍ͯͨ͠ͷͰɺ΄΅͜Ε
    ͚ͩͰࡁΜͩ
    w qBOLKBS͸.#΋͋ΔͷͰHJU؅ཧ͠ͳ͍
    ಋೖํ๏

    View full-size slide

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

    View full-size slide

  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)

    View full-size slide

  21. ϖʔδλΠτϧ ϖʔδαϒλΠτϧ
    ©2018 Wantedly, Inc.

    View full-size slide

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

    View full-size slide

  23. ©2018 Wantedly, Inc.
    ·ͱΊ

    View full-size slide

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

    View full-size slide

  25. ϖʔδλΠτϧ ϖʔδαϒλΠτϧ
    ©2018 Wantedly, Inc.
    5IBOLZPV

    View full-size slide

  26. ©2018 Wantedly, Inc.
    w ςετγϟʔυ UFTU4IBSET
    ͕࠷଎
    w ςετ਺෼ͷ՝ۚൃੜ
    w ฐࣾͷ৔߹ͷݸͳΒ
    w ࠷ॳ͸UFTU4IBSE'MBOLͳ͠Ͱͷ࣌ؒ ෼

    w ίετΛݟͭͭUFTU4IBSEݮΒͯ͠ௐ੔
    ௐ੔

    View full-size slide

  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

    View full-size slide