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
77
少し変わった論理削除
gyugyu
3
17k
Other Decks in Technology
See All in Technology
podman_update_2024-12
orimanabu
1
300
日本版とグローバル版のモバイルアプリ統合の開発の裏側と今後の展望
miichan
1
140
新機能VPCリソースエンドポイント機能検証から得られた考察
duelist2020jp
0
240
[トレノケ雲の会 mod.13] 3回目のre:Inventで気づいたこと -CloudOperationsを添えて-
shintaro_fukatsu
0
110
宇宙ベンチャーにおける最近の情シス取り組みについて
axelmizu
0
120
型情報を用いたLintでコード品質を向上させる
sansantech
PRO
2
160
20241218_今年はSLI/SLOの導入を頑張ってました!
zepprix
0
200
[Oracle TechNight#85] Oracle Autonomous Databaseを使ったAI活用入門
oracle4engineer
PRO
1
150
小学3年生夏休みの自由研究「夏休みに Copilot で遊んでみた」
taichinakamura
0
190
メンタル面でもつよつよエンジニアになる/登壇資料(井田 献一朗)
hacobu
0
140
Zero Data Loss Autonomous Recovery Service サービス概要
oracle4engineer
PRO
1
4.8k
非機能品質を作り込むための実践アーキテクチャ
knih
5
1.7k
Featured
See All Featured
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
A better future with KSS
kneath
238
17k
Bash Introduction
62gerente
609
210k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Learning to Love Humans: Emotional Interface Design
aarron
274
40k
GraphQLとの向き合い方2022年版
quramy
44
13k
The Language of Interfaces
destraynor
155
24k
Product Roadmaps are Hard
iamctodd
PRO
50
11k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
66k
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 ൃදҎ্Ͱ͢ ▸ ͋Γ͕ͱ͏͍͟͝·ͨ͠