Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Android CI: 2016 edition
Search
Yusuke Yagyu
February 19, 2016
Technology
3
2.3k
Android CI: 2016 edition
DroidKaigi 2016 の発表資料です。
Yusuke Yagyu
February 19, 2016
Tweet
Share
More Decks by Yusuke Yagyu
See All by Yusuke Yagyu
ペパボのデザインシステムと、モバイル領域における取り組み
gyugyu
0
1.1k
Dart Sass であれを作った
gyugyu
0
76
少し変わった論理削除
gyugyu
3
17k
Other Decks in Technology
See All in Technology
強いチームと開発生産性
onk
PRO
33
11k
The Role of Developer Relations in AI Product Success.
giftojabu1
0
120
OCI 運用監視サービス 概要
oracle4engineer
PRO
0
4.8k
OCI Security サービス 概要
oracle4engineer
PRO
0
6.5k
Lambdaと地方とコミュニティ
miu_crescent
2
370
Incident Response Practices: Waroom's Features and Future Challenges
rrreeeyyy
0
160
Taming you application's environments
salaboy
0
180
AWS Lambdaと歩んだ“サーバーレス”と今後 #lambda_10years
yoshidashingo
1
170
EventHub Startup CTO of the year 2024 ピッチ資料
eventhub
0
110
Lambda10周年!Lambdaは何をもたらしたか
smt7174
2
110
インフラとバックエンドとフロントエンドをくまなく調べて遅いアプリを早くした件
tubone24
1
430
VideoMamba: State Space Model for Efficient Video Understanding
chou500
0
190
Featured
See All Featured
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
Optimizing for Happiness
mojombo
376
70k
Fireside Chat
paigeccino
34
3k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Facilitating Awesome Meetings
lara
50
6.1k
YesSQL, Process and Tooling at Scale
rocio
169
14k
Ruby is Unlike a Banana
tanoku
97
11k
Into the Great Unknown - MozCon
thekraken
32
1.5k
Producing Creativity
orderedlist
PRO
341
39k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
410
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
44
2.2k
Transcript
ANDROID CI: 2016 EDITION YUSUKE YAGYU AT DROIDKAIGI 2016 DAY
02
ANDROID CI; 2016 EDITION ࣗݾհ ▸ GMO ϖύϘגࣜձࣾ ٕज़෦ ٕज़ج൫νʔϜ
▸ ͍Ζ͍Ζ࡞͍ͬͯΖ͍Ζ͢ਓ݉ςετ͓͡͞Μ ▸ Android ΞϓϦ։ൃࣗମϝΠϯͰͳ͍Ͱ͢ ▸ ຖே࠷৽ͷ PHP / Ruby / Python3 ΛϏϧυ͢Δͷ͕ੜ͖͕ ͍
ANDROID CI: 2016 EDITION ରௌߨऀ ▸ ॳ৺ऀʙதڃऀ ▸ ΞϓϦ։ൃͰ͖Δ͕ɺςετͲ͔͜ΒखΛ͚͍͍ͭͯͷ ͔Θ͔Βͳ͍ํ
▸ യવͱςετॻ͚Δ͕ɺAndroidStudio Ͱ͔͠ςετͨ͠ ͜ͱ͕ͳ͍ਓ
ANDROID CI: 2016 EDITION ຊͷςʔϚ ▸ ։ൃϑϩʔʹ͓͚Δ Android ςετͷྨ ▸
Android ςετࣗಈԽͷϓϥϯχϯά ▸ Android ʹ͓͚Δ CI ͷϓϥϯχϯά ▸ Android CI ͷύλʔϯ
ANDROID CI: 2016 EDITION DISCLAIMER ▸ ͜ͷεϐʔν20162݄࣌ͷใͰ͋Γɺ͝ཡͷ࣌Ͱ ࠷৽ͷใͰ͋Δ͜ͱΛอূ͠·ͤΜ
ANDROID CI; 2016 EDITION ࠷ॳʹେࣄͳ݁Λ ▸ Android ։ൃʹݶΒͣɺࣗಈςετ / CI
Ͳ͜ΛऔΔ͔ɺͲ ͜ΛΓࣺͯΔ͔ɺҰछͷՁஅͰ͋Δ ▸ அج४ͱͯ͠ɺٕज़త੍ɺਓతϦιʔεɺ࣌ؒత੍ɺ ༧ࢉͷ੍͕ڍ͛ΒΕΔ
։ൃϑϩʔʹ͓͚Δ ANDROID ςετͷྨ
ANDROID CI: 2016 EDITION ͓͞Β͍ɿҰൠతͳ։ൃϑϩʔ ▸ ʮҰൠతͳʯV ࣈ։ൃϞσϧ ▸ ཁ݅ੳˠجຊઃܭˠৄࡉઃܭˠ։ൃˠ
▸ ୯ମςετˠ݁߹ςετˠγεςϜςετˠडೖςετ
ANDROID CI: 2016 EDITION ςετͷछྨͱࣗಈςετͷରԠ ▸ ୯ମςετɿUnit Test, Ұ෦ͷ Instrumentation
Test ▸ ݁߹ςετɿ΄ͱΜͲͷ Instrumentation Test ▸ γεςϜɾडೖςετɿEnd-to-end Test ▸ ʢิʣ୳ࡧతςετɿओʹखಈʹΑΔ
ANDROID CI: 2016 EDITION UNIT TEST ▸ app/src/test σΟϨΫτϦ ▸
JVM / JUnit4 ϕʔεͷςετ ▸ ߴͳςετ ▸ Android SDK ґଘͷ෦ςετෆՄೳ
ANDROID CI: 2016 EDITION INSTRUMENTATION TEST (ANDROID TEST) ▸ app/src/androidTest
σΟϨΫτϦ ▸ ࣮ػɾΤϛϡϨʔλΛ༻ͯ͠ͷςετ ▸ Android SDK ґଘͷίʔυςετՄೳ ▸ Activity ͷදࣔςετՄೳ
ANDROID CI: 2016 EDITION INSTRUMENTATION TEST ͷϝϦοτ ▸ ֎෦ґଘʢe.g. Web
API ίʔϧʣͷ͋ΔίʔυΛϞοΫԽ Մೳ ▸ ϞοΫԽ͢Δ͜ͱͰྫ֎ঢ়ଶͷςετ͕Մೳ
ANDROID CI; 2016 EDITION INSTRUMENTATION TEST ͷ͠͞ ▸ e.g. Web
API ίʔϧ͕ଘࡏ͢Δ߹ɺϞοΫ͞ΕͨϨεϙ ϯε͕࠷৽ͷͷͰ͋Δ͜ͱΛͲ͏୲อ͢Δʁ ▸ Fixture ϕʔεʹͯ͠ JSON Schema Ͱݕূ͢Δʁ ▸ μϛʔ API αʔόΛཱͯΔʁ
ANDROID CI: 2016 EDITION END-TO-END TEST ▸ ϏϧυࡁΈͷ APK ʹର͢Δૢ࡞ςετ
▸ Πϯετʔϧࡁͷଞͷ APK ͱͷڠௐΛࢼݧ ▸ εΫϦʔϯγϣοτͷࡱӨՄೳ
ANDROID CI; 2016 EDITION END-TO-END TEST ͷ͠͞ ▸ e.g. Ͳ͜·ͰΛͯ͠
End-to-end Test ͱఆٛ͢Δ͔ʁ ▸ Production αʔόଓ͢Δʁ ▸ Build Flavor Λ༻ͯ͠σόοά༻ API Λ࣋ͭݕূ༻αʔό ʹଓ͢Δʁ
ANDROID ςετࣗಈ Խͷϓϥϯχϯά
ANDROID CI: 2016 EDITION ANDROID ࣗಈςετͰසग़͢Δ୯ޠ ▸ JUnit ▸ Mockito
▸ Robolectric ▸ Espresso ▸ UI Automator ▸ Appium
ANDROID CI: 2016 EDITION ROBOLECTRIC ▸ Unit Test ༻ͷ Android
SDK shim ▸ JVM ্Ͱ RuntimeException ʹͳΔ Android SDK ෦Λ shadow ʹࠩ͠ସ͑͢Δ ▸ Android SDK ґଘίʔυΛ Unit Test Մೳʹ͢Δ
ANDROID CI: 2016 EDITION ROBOLECTRIC༗༻͔ʁ ▸ ʮ෦తʹʯ༗༻ ▸ Bundle, Intent
୯७ͳ Map ͱͯ͠ར༻Մೳ ▸ AsyncTaskLoader ͷಉظԽ ▸ ͦΕҎ֎ͷʢಛʹ݁߹ߴ͍ʣ API ੬͍
ANDROID CI: 2016 EDITION MOCKITO ▸ Unit Test, Instrumentation Test
Ͱ͑ΔϞοΫϥΠϒϥϦ ▸ ଞʹީิ͋Δ ▸ Spy, Stub ͷҧ͍ʹҙ
ANDROID CI: 2016 EDITION ESPRESSO ▸ Instrumentation Test ͷߴϨϕϧϥούʔ ▸
ඇಉظͳ Activity ͷςετΛಉظతʹॻ͚Δ ▸ Testing Support Library ͷҰ෦
ANDROID CI: 2016 EDITION UI AUTOMATOR ▸ End-to-end Test πʔϧ
▸ Testing Support Library ͷҰ෦ ▸ Android OS >= 4.1
ANDROID CI: 2016 EDITION APPIUM ▸ Selenium ޓͷ End-to-end ςετπʔϧ
▸ Java, JavaScript (Node), .NET, PHP, Python, Ruby, Perl ͳͲ ݴޠΛΘͣςετίʔυ͕ॻ͚Δ
ANDROID CI: 2016 EDITION ςετϑΣʔζͱπʔϧબఆ ▸ ςετΛαϙʔτ͢ΔπʔϧΛબఆ͢Δ ▸ End-to-end Test
πʔϧબఆཁߟྀ ▸ Testing Support Library మ൘
ANDROID CI: 2016 EDITION ςετࣗಈԽͷηΦϦʔ ▸ ࣮ߦ୯ମʼ݁߹ʼडೖͷॱʹ͘ͳΔ ▸ ͭ·Γέʔε୯ମʼ݁߹ʼडೖͷॱʹ͢Δͷ͕ϕετ ▸
͜Ε Android ։ൃʹ͍ͭͯಉ༷ͷ͜ͱݴ͑Δ
ANDROID CI: 2016 EDITION ςετΛͲ͏ࣗಈԽ͢Δ͔ʁ ▸ ՔಇதͷΞϓϦ͕͋Δ߹ͱ৽ن։ൃͷ߹ͰมԽ ▸ Քಇதͷ߹ɿ Instrumentation
Test / End-to-end Test ͰՔ ಇΛ୲อ͠ͳ͕ΒϦϑΝΫλϦϯά ▸ ৽ن։ൃͷ߹ɿ MVP Architecture ͳͲͰ SDK ͔Βϩδο ΫΛΓ͠ Unit Test Λް͘͢Δ
ANDROID CI: 2016 EDITION Ͳ͜·ͰςετΛॻ͖͔͘ʁ ▸ ԾʹΧόϨοδ 100% ͩͬͨͱͯ͠ఆ࿙Ε͕ൃੜ͢Δ ▸
End-to-end Test ͰϋοϐʔύεʢޭύλʔϯʣҎ֎Λॻ ͘͜ͱ͍͠ ▸ ʮ҆৺͢Δ·ͰςετΛॻ͘ʯ(@ahomu)
ANDROID CI: 2016 EDITION ٯʹݴ͑ ▸ End-to-end Test ͚ͩΛॻ͍ͯʮಈ͘͜ͱ͚ͩʯ୲อ͢Δ ͷҰͭͷख
▸ ςετͷϓϥϯχϯάਓతϦιʔεͷଟՉɺϝϯόʔͷٕ ज़ྗɺϦϦʔε·ͰͷΓ࣌ؒʹج͍ͮͯಋग़͢Δ
ANDROID CI: 2016 EDITION ॏཁͳͷ ▸ νʔϜͷϝϯόʔશһ͕ࣗಈςετͷॏཁ͞Λ࣮ײ͢Δ͜ͱ ▸ νʔϜͷ։ൃऀશһ͕࣮ࡍʹखΛಈ͔ͯ͠ςετίʔυΛॻ ͚ΔΑ͏ʹͳΔ͜ͱ
▸ ςετίʔυΛॻ͘ͷ͕͍͠෦ΛΓ͚ΒΕΔʮςε τʹڧ͍ΤϯδχΞʯ͕͍Δͱͳ͓Α͍
ANDROID ʹ͓͚Δ CI ͷϓϥϯχϯά
ANDROID CI: 2016 EDITION Ωʔϫʔυ ▸ Jenkins ▸ ίϯςφϕʔε CI
αʔϏε ▸ Device Farm ▸ Smartphone Test Farm
ANDROID CI: 2016 EDITION JENKINS ▸ Jenkins + Git Plugin
/ GitHub Plugin ▸ αʔόߏΛίϯτϩʔϧՄೳʹ࣮ػଓՄೳ ▸ Unit Test, Instrumentation Test, End-to-end Test શͯΧόʔ ▸ ʮJenkins ৬ਓʯ
ANDROID CI: 2016 EDITION ίϯςφϕʔε CI ▸ e.g. Travis CI,
Circle CI, Drone, Wercker… ▸ ൺֱత҆Ձʢ̌ԁʙʣͰςετՄೳ ▸ JVM ϕʔεͷߴςετΛಘҙͱ͢Δ ▸ Activity Test / End-to-End Test Λߦ͏ͳΒผͷΈ͕ඞཁ
ANDROID CI: 2016 EDITION DEVICE FARM ▸ ෳͷ࣮ػʢɺOSόʔδϣϯʣΛςετ࣮ߦڥͱ͠ ͯ͑Δ ▸
ಠࣗςετ DSL, Web ϕʔεͷը໘ૢ࡞ͳͲ ▸ DFaaS (Device Farm as a Service) ͷ Amazon / Google ࢀೖʢGoogle Cloud Test Lab Closed Test தʣ
ANDROID CI: 2016 EDITION CI ͚ DFAAS ͷબఆج४ ▸ طଘͷςετࢿ࢈
(Instrumentation Test, End-to-end Test) ͕͑Δ͔ʁ ▸ Jenkins Plugin ͕༻ҙ͞Ε͍ͯΔ͔ʁ ▸ Gradle Plugin ͕༻ҙ͞Ε͍ͯΔ͔ʁ ▸ Web API ͕༻ҙ͞Ε͍ͯΔ͔ʁ
ANDROID CI: 2016 EDITION SMARTPHONE TEST FARM (STF) ▸ Device
Farm Λ in-house Ͱ࣋ͭπʔϧ ▸ Device Farm ͷඪ४తͳػೳΛҰ௨Γ࣋ͭ ▸ adb connect ʹΑΔϦϞʔτσόοά
ANDROID CI: 2016 EDITION STF 2.0 ▸ REST APIʢঢ়ଶɺϩοΫऔಘʣͷՃ ▸
ΑΓࣗಈςετͱੑͷߴ͍ػೳΛऔಘ
ANDROID CI: 2016 EDITION CI Λલఏͱͨ͠ςετΛॻ͘ ▸ ςετલޙͰͷঢ়ଶ͕มΘΒͳ͍͜ͱΛ୲อ͢Δ ▸ ΤϛϡϨʔλΛഁغ͢ΔɺΛϫΠϓ͢ΔͳͲ
▸ ୯ମʼ݁߹ʼडೖͷέʔεηΦϦʔΛकΒͳ͍ͱɺ͙͢ʹ ࣮ߦ͕࣌ؒരൃతʹ͘ͳΔ
ANDROID CI: 2016 EDITION ϓϥϯχϯάઓज़ ▸ Jenkins Λϝϯςφϯε͢ΔਓతϦιʔε͕֬อͰ͖ΔͷͰ ͋ΕɺJenkins ▸
Jenkins Λϝϯςφϯε͢ΔਓతίετΛ DFaaS ར༻ྉʹ సԽͰ͖ΔͳΒɺίϯςφϕʔε CI + DFaaS
ANDROID CI: 2016 EDITION େࣄͳͷ ▸ CI Λߦ͏͜ͱͰࣗಈςετΛश׳Խ͠ɺ࣭ΛԼ͛ͳ͍͜ ͱΛνʔϜͷϝϯόʔશһͰ߹ҙ͢Δ͜ͱ ▸
ݱ࣌Ͱ Device Farm աظʹ͋Γɺಛఆͷϓϥοτ ϑΥʔϜʹաʹґଘ͢ΔͱɺϨΨγʔԽ͢ΔϦεΫΛ๊͑ Δ
ANDROID CIͷύ λʔϯ
ANDROID CI: 2016 EDITION ύλʔϯ̍ ▸ Jenkins + ࣮ػଓʢ͘͠ΤϛϡϨʔλʣ ▸
࠷γϯϓϧͳߏ ▸ ༨ΓϦιʔεͰελʔτͰ͖Δͱ͍͏ख͕ܰ͋͞Δ ▸ ͷଟ༷ԽʹखಈͰਵ͠ͳ͚ΕͳΒͳ͍
ANDROID CI: 2016 EDITION ύλʔϯ̎ ▸ Jenkins + (Docker) +
STF + ࣮ػଓ ▸ γϯϓϧͳߏΛ֦ுͯ͠ɺͷଟ༷ੑʹਵՄೳʹͨ͠ ύλʔϯ ▸ Λ༻ҙ͢Δίετͱϝϯςφϯεʹ͔͔ΔਓతϦιʔε ͕՝
ANDROID CI: 2016 EDITION ύλʔϯ̏ ▸ ίϯςφϕʔε CI αʔϏε +
DFaaS ▸ ϝϯςφϯεϑϦʔͳ CI ύλʔϯ ▸ DFaaS ͷอ࣋͢Δʹ੍Λड͚Δ
ANDROID CI: 2016 EDITION ฐࣾʹ͓͚Δ CI ͷ࠾༻ঢ়گ ▸ minne ϞόΠϧΞϓϦʹ
CI ಋೖ ▸ ύλʔϯ̎ͱύλʔϯ̏Λซ༻͠ɺൺֱݕ౼த
ANDROID CI: 2016 EDITION ݁Λ܁Γฦ͠ ▸ Android ։ൃʹݶΒͣɺࣗಈςετ / CI
Ͳ͜ΛऔΔ͔ɺͲ ͜ΛΓࣺͯΔ͔ɺҰछͷՁஅͰ͋Δ ▸ அج४ͱͯ͠ɺٕज़త੍ɺਓతϦιʔεɺ࣌ؒత੍ɺ ༧ࢉͷ੍͕ڍ͛ΒΕΔ
ANDROID CI: 2016 EDITION ൃදҎ্Ͱ͢ ▸ ͋Γ͕ͱ͏͍͟͝·ͨ͠