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

シナリオに依存しないテストの基盤作ってます / We're developing an infrastracture for tests not depending schenarios

Kuniwak
October 02, 2019

シナリオに依存しないテストの基盤作ってます / We're developing an infrastracture for tests not depending schenarios

https://testnight.connpass.com/event/145238/

一度非公開にしていましたが、再公開しました。

Kuniwak

October 02, 2019
Tweet

More Decks by Kuniwak

Other Decks in Programming

Transcript

  1. γφϦΦʹґଘ͠ͳ͍

    ςετͷج൫࡞ͬͯ·͢
    $*$%5FTU/JHIU ,VOJXBL

    View full-size slide

  2. ൃදͷྲྀΕ
    ԿΛ$*ʹࡌ͍ͤͨͷ͔
    $*ʹࡌͤΔࡍͷ՝୊
    EFWGBSNʢ·ͩະެ։ʣͷ঺հ

    View full-size slide

  3. ԿΛ$*ʹࡌ͍ͤͨͷ͔

    View full-size slide

  4. ࠷ۙͷ೰Έ
    ϞόΠϧήʔϜͷόάΛͰ͖Δ͚ͩ

    खલͷϑΣʔζͰݟ͚͍ͭͨ
    ཁ͢Δʹ୯ମςετͱ͔Ͱ

    ݟ͚ͭΒΕΔͳΒͱͯ΋خ͍͕͠ʜ

    View full-size slide

  5. ୯ମςετͭΒ͍
    ήʔϜΤϯδϯ౎߹ͷ

    ίϯϙʔωϯτ෼ׂΛڧ੍͞Εɺ

    ҙຯͷ͋Δཻ౓Ͱͷ෼ׂΛ

    ͮ͠Β͍ʢ΍Γํ͸͋Δ͕ʣ

    View full-size slide

  6. ୯ମςετͭΒ͍
    ͭ·Γɺ୯ମςετ͸ॻ͚Δ͚Ͳ

    Կ΋Θ͔Βͳ͍͜ͱ͕ଟ͍

    View full-size slide

  7. Ͱ͸݁߹ςετʁ
    ݁߹ςετ͸͋·ΓʹͭΒ͍ɿ
    w ͙͢յΕΔ
    w ͭͷςετέʔεͰ

    ௐ΂ΒΕΔܦ࿏͸͘͝Θ͔ͣ

    View full-size slide

  8. Ͱ͸6*ςετʁ
    6*ςετ͸อक͕ͭΒ͍ɿ
    w γφϦΦ͸͙͢յΕΔ
    w ͦ΋ͦ΋γφϦΦ͕ಈ͘·Ͱ΋

    ࢼߦαΠΫϧ௕ͯͭ͘Β͍

    View full-size slide

  9. ݁࿦ʢʁʣ
    ήʔϜͷςετ͸Կ΍ͬͯ΋ͭΒ͍

    View full-size slide

  10. ໰୊ͷ੔ཧ
    w ઃܭʹࠨӈ͞ΕΔͱݫ͍͠
    w ݁߹Λ૿΍͢ͱյΕ΍ͯ͘͢ݫ͍͠
    w ࢼߦαΠΫϧ௕͍ͱݫ͍͠

    View full-size slide

  11. ໰୊ͷ੔ཧ
    w ͜ΕΒΛશͯճආ͢Δͪΐ͏Ͳ͍͍

    ςετ͕࣮͸͋Δʜ

    View full-size slide

  12. ໰୊ͷ੔ཧ
    w ୯ମςετͰҙຯΛ࣋ͨͤͮΒ͍෼ׂཻ౓
    w ݁߹Ϩϕϧ্͛Ε͹ճආՄೳ
    w ͲͷΑ͏ʹ෼ׂɾ݁߹͞Εͯ΋

    ݁߹ͯ͠͠·͑͹ςετ͸Ͱ͖Δ

    View full-size slide

  13. ໰୊ͷ੔ཧ
    w ݁߹Λ૿΍͢ͱյΕ΍ͯͭ͘͢Β͍
    w ಛఆͷೖग़ྗΛݕূ͢ΔͳΒ

    յΕΔͷ͸ճආͰ͖ͳ͍
    w Ұൠతͳੑ࣭ͷݕূͳΒճආՄೳ

    View full-size slide

  14. ໰୊ͷ੔ཧ
    w ࢼߦαΠΫϧ௕͍ͱݫ͍͠
    w ໰୊͸खಈͰେྔʹ࡞Δͱ͖
    w ೖग़ྗͷࣗಈੜ੒Ͱ؇࿨Մೳ

    View full-size slide

  15. ͭ·Γʜ
    ԼͷςετͳΒήʔϜͰ΋ޮՌతɿ
    w ݁߹Ϩϕϧ͕ߴ͘ɺ
    w Ұൠతͳੑ࣭Λݕূ͠ɺ
    w ೖग़ྗ͸ࣗಈͰੜ੒͞ΕΔ

    View full-size slide

  16. ͦΜͳςετ͸͋Δͷ͔ʁʁʁ
    ͋Γ·͢

    View full-size slide

  17. 6*ϨΠϠʔͷ

    ϞϯΩʔςετ
    6*ૢ࡞ΛࣗಈͰແ࡞ҝʹ࣮ߦ͠ɺ

    Ϋϥογϡ΍ύϑΥʔϚϯε໰୊Λ

    ൃݟ͢Δํ๏ʢΦʔτϓϨΠͷҰछʣ

    View full-size slide

  18. #VUUPO"
     ͭʹߜΓࠐΉ
    ⁞ૢ࡞Մೳͳ΋ͷΛબ୒ ⁠ແ࡞ҝʹૢ࡞Λ࣮ߦ
    #VUUPO#
    #VUUPO$
    #VUUPO%
    #VUUPO"
    #VUUPO#
    #VUUPO"
    5BQ

    View full-size slide

  19. զʑ͕$*ʹࡌ͍ͤͨ΋ͷ
    ήʔϜͰݱ࣮త͔ͭޮ཰తͳ

    ςετͱͯ͠ɺ6*ϨΠϠʔͷ

    ϞϯΩʔςετΛࡌ͍ͤͨʂ

    View full-size slide

  20. طଘπʔϧ
    "QQJVN΍"MU6OJUZ5FTUFS͕༗໊
    ͜ΕΒ͸࢖͑ͳ͍͜ͱ͸ͳ͍͕ɺ

    ૢ࡞Մೳͳ΋ͷͷબ୒͕खؒͩ͠ɺ

    πʔϧͷ૝ఆ֎ͷ༻్ͳͷͰةݥ

    View full-size slide

  21.  ͭʹߜΓࠐΉ
    ⁞ૢ࡞Մೳͳ΋ͷΛબ୒ ⁠ແ࡞ҝʹૢ࡞Λ࣮ߦ
    ͕͜͜طଘπʔϧͩͱͭΒ͍
    #VUUPO"
    #VUUPO#
    #VUUPO$
    #VUUPO"
    #VUUPO#
    #VUUPO"
    5BQ

    View full-size slide

  22. ΞϓϦʹຒΊࠐΉํࣜΛ࠾༻
    ΞϓϦͷϏϧυ࣌ʹ͜ͷૢ࡞πʔϧΛ

    ຒΊࠐΉ͜ͱͰɺطଘπʔϧͷ໘౗ͳ

    ෦෼Λղܾ
    ΞϓϦΛىಈ͢Ε͹ςετ͞ΕΔ

    View full-size slide

  23. $*ʹࡌͤΔࡍͷ՝୊

    View full-size slide

  24. Ͳ͜ͰΞϓϦΛಈ͔͔͢
    ࣮ࡍʹΞϓϦΛಈ͔͢ඞཁ͕͋ͬͯɺ

    ࣮ͨͩ͠ػͰ͋Δඞཁੑ͸ͦ͜·Ͱ

    ߴ͘ͳ͍
    ͨ͘͞Μԣʹฒ΂ͯಈ͔͍ͨ͠͠ɺ

    γϛϡϨʔλ࢖͑ΔͳΒ͕͍͍ͦͬͪ

    View full-size slide

  25. γϛϡϨʔλΫϥ΢υʜʁ
    J04"OESPJEͷ࣮ػσόΠεΛΫϥ΢υͰ

    ࣮ߦ͢ΔαʔϏε͸͍͔ͭ͘஌ΒΕ͍ͯΔ
    ͔͠͠γϛϡϨʔλΛΫϥ΢υͰ࣮ߦ͢Δ

    αʔϏε΋Θ͔ͣʹ͋Δ͕࢖͍ͮΒ͍ʜ

    View full-size slide

  26. ݱঢ়ͷํ਑
    কདྷతʹ͸γϛϡϨʔλͰ΋ಈ͔͍͕ͨ͠
    ࠓ͸·࣮ͩػ͔͠ͳ͍ͷͰɺ
    Ҡߦίετͷগͳ͍ঢ়ଶΛอͪͭͭɺ

    ૣΊʹऔΓ૊Έ͍ͨ

    View full-size slide

  27. ͦ͜ͰEFWGBSN
    ࣮ػͱγϛϡϨʔλͷ੾Γସָ͕͑Ͱɺ

    σόΠεΫϥ΢υ্ͰΞϓϦͷىಈঢ়گΛ
    ؅ཧ͢Δπʔϧ
    ·ͩະެ։͚ͩͲকདྷతʹ͸044༧ఆ

    View full-size slide

  28. EFWGBSNͷ঺հ

    View full-size slide

  29. EFWGBSNͰͰ͖Δ͜ͱ
    w ࢦఆͨ͠σόΠεΫϥ΢υ04ػछ

    ୆਺ΞϓϦҾ਺ͰΞϓϦΛىಈ
    w ΞϓϦ͕Ϋϥογϡͨ͠ΒίϚϯυΛ

    ҟৗऴྃɺࢦఆ࣌ؒੜଘͨ͠Βਖ਼ৗऴྃ

    View full-size slide

  30. ͑ɺͦΕ͚ͩʜ

    View full-size slide

  31. ཧ༝͕ʜ͋Γ·͢ʜ

    View full-size slide

  32. EFWGBSNͷࢥ૝
    ࣮ػɾγϛϡϨʔλɾσόΠεΫϥ΢υΛ

    ໰Θͣɺಉ͡ΠϯλʔϑΣʔεͰ

    ىಈɾऴྃ͢Δ͜ͱͷΈʹઐ೦͢Δ
    ಛఆͷ৚݅Ͱ͔͠αϙʔτͰ͖ͳ͍ػೳ͸

    αϙʔτ͠ͳ͍ʢػೳͷੵू߹ओٛʣ

    View full-size slide

  33. $ devfarm run-ios --os-version 12.0 \

    --device 'apple iphone xs' \

    --instance-group 'example' \

    --platform 'aws-device-farm' \

    --ipa 'path/to/app.ipa' \

    --args-json '["-ARG1", "HELLO_DEVFARM"]' \

    --lifetime-sec 900 &
    platform status
    aws-device-farm launching
    J04ΞϓϦΛͭىಈ

    View full-size slide

  34. $ devfarm status --instance-group 'example'

    platform device os state note
    aws-device-farm apple iphone xs ios ACTIVE
    ىಈ͍ͯ͠ΔΞϓϦͷ֬ೝ

    View full-size slide

  35. $ devfarm halt --instance-group 'example'

    platform status
    aws-device-farm halting
    ΞϓϦͷڧ੍ऴྃ

    View full-size slide

  36. instance_groups:
    :
    # for Android
    - platform: # required
    android: # required
    device: # required
    apk: # required
    app_id: # required
    intent_extras: [] # optional
    lifetime_sec: 900 # required
    $ devfarm run-all planfile.yml
    ෳ਺ΞϓϦͷҰׅىಈ

    View full-size slide

  37. EFWGBSNͱ͸
    ࣮ػͱγϛϡϨʔλͷ੾Γସָ͕͑Ͱɺ

    σόΠεΫϥ΢υ্ͰΞϓϦͷىಈঢ়گΛ
    ؅ཧ͢Δπʔϧ
    ·ͩະެ։͚ͩͲকདྷతʹ͸044༧ఆ

    View full-size slide

  38. ·ͱΊ
    w ϞόΠϧήʔϜʹ΋ޮ཰తͰ

    ݱ࣮తͳςετΛೖΕ͍ͨʂ
    w ݱࡏͷπʔϧΫϥ΢υͷঢ়گͰ΋

    ಈ͔ͤͯɺকདྷΛݟӽͨ͠

    πʔϧΛ࡞Γ·ͨ͠
    w 044ԽͰ͖ͨΒͥͻ͓ࢼ͠Λ

    View full-size slide