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
iOS 開発での Pull Request と テストカバレッジの連携
Search
star__hoshi
March 13, 2017
Technology
4
3.3k
iOS 開発での Pull Request と テストカバレッジの連携
iOS Test Night #3
https://testnight.connpass.com/event/49561/
star__hoshi
March 13, 2017
Tweet
Share
More Decks by star__hoshi
See All by star__hoshi
大統一ロガーを利用したサービス開発
starhoshi
0
3.1k
Komerco-コメルコ-を支える技術
starhoshi
4
5.9k
実践 Cloud Functions for Firebase
starhoshi
7
5.7k
個人アプリでレビューを高くするためにやっていること
starhoshi
2
1.7k
個人開発を加速させるツール群
starhoshi
54
22k
fastlane 勉強会
starhoshi
0
790
VIPER Architecture から学ぶ Dependency Injection
starhoshi
3
2.1k
学校の iOS 端末事情
starhoshi
0
2.3k
iOS が fastlane なら Android も fastlane に乗ってみては?
starhoshi
0
2.8k
Other Decks in Technology
See All in Technology
“新卒らしさ”を脱ぎ捨てて 〜1年を経て学んだこと〜
rebase_engineering
0
130
それでもぼくらは貢献をつづけるのだ(たぶん) @FOSS4GLT会#002
furukawayasuto
1
270
エンジニアが組織に馴染むために勉強会を主催してチームの壁を越える
ohmori_yusuke
2
110
オープンソースのハードウェアのコンテストに参加している話
iotengineer22
0
510
Oracle Database オプティマイザ・ヒントの活用
oracle4engineer
PRO
1
140
いまさら聞けない Git 超入門 〜Gitって結局なに?から始める第一歩〜
devops_vtj
0
150
GoogleのAI Agent
shukob
0
100
Postman AI エージェントビルダー最新情報
nagix
0
190
Contract One Dev Group 紹介資料
sansan33
PRO
0
6k
Azure Developer CLI と Azure Deployment Environment / Azure Developer CLI and Azure Deployment Environment
nnstt1
1
120
OTel meets Wasm: プラグイン機構としてのWebAssemblyから見る次世代のObservability
lycorptech_jp
PRO
1
290
ソフトウェアは捨てやすく作ろう/Let's make software easy to discard
sanogemaru
10
5.7k
Featured
See All Featured
GraphQLとの向き合い方2022年版
quramy
46
14k
The Power of CSS Pseudo Elements
geoffreycrofte
76
5.8k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.5k
Adopting Sorbet at Scale
ufuk
76
9.4k
How to train your dragon (web standard)
notwaldorf
92
6k
Testing 201, or: Great Expectations
jmmastey
42
7.5k
What's in a price? How to price your products and services
michaelherold
245
12k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
840
Building an army of robots
kneath
306
45k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.7k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.2k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Transcript
iOS ։ൃͰͷ Pull Request ͱ ςετΧόϨοδͷ࿈ܞ iOS Test Night #3
by @star__hoshi
ΞδΣϯμ • ࣗݾհ • ςετΧόϨοδܭଌ • ϓϧϦΫͱͷ࿈ܞ • ͓·͚
ࣗݾհ • Twitter: @star__hoshi • GitHub: starhoshi • Classiגࣜձࣾ •
iOS ΤϯδχΞ
ΧόϨοδͬͯʁ ϝϦοτʁσϝϦοτʁ ΧόϨοδΛຬͨ͢ͱ্࣭͕͕Δͷʁ ΧόϨοδϙϦεϝϯ
ͱ͍͏͠·ͤΜ ͳͥͳΒ5͔͠ͳ͍͔Β
࣮ࡍʹܭଌ͢Δ ͱ͍͏Λ͠·͢
ܥ
Xcode ʹ͓͚Δ ΧόϨοδܭଌํ๏
Xcode: EditScheme > XxxTests Gather coverage data ʹνΣοΫೖΕΔ
͜Μͳײ͡Ͱ݁Ռ͕ग़Δ
ϩʔΧϧͰܭଌͰ͖Δ ͕ ϓϧϦΫʹ࿈ܞ͍ͨ͠
fastlane scan + fastlane action
fastlane scan ؆୯ʹςετΛ࣮ߦ (ઃఆϑΝΠϧඞཁ) IUUQTHJUIVCDPNGBTUMBOFGBTUMBOFUSFFNBTUFSTDBO
fastlane action | grep coverage • lcov • xcov •
gcovr • slather
fastlane action | grep coverage • lcov • xcov •
gcovr • slather
nakiostudio/xcov IUUQTHJUIVCDPNOBLJPTUVEJPYDPW
nakiostudio/danger-xcov IUUQTHJUIVCDPNOBLJPTUVEJPEBOHFSYDPW
danger IUUQEBOHFSTZTUFNT ϓϧϦΫʹ merge OK ͔νΣοΫͰ͖Δ
IUUQOJXBUBLPIBUFOBCMPHKQFOUSZ
fastlane scan + danger-xcov + CI Server
gem 'fastlane' gem 'danger-xcov' gem 'danger' Gemfile
scheme "HogeTests" configuration "Staging" device "iPad Retina" workspace "hoge.xcworkspace" clean
true skip_build true fastlane/Scanfile
xcov.report( workspace:"hoge.xcworkspace", scheme:"HogeTests", minimum_coverage_percentage:40 ) Dangerfile minimum_coverage_percentage ΛԼճΔͱ Merge Ͱ͖ͳ͍
lane :test do scan danger end fastlane/Fastfile
test: override: - bundle exec fastlane test CI Ͱ࣮ߦ CircleCI
Ͱͷྫ:
DANGER_GITHUB_API_TOKEN https://github.com/settings/tokens/new ͰAPIτʔΫϯΛऔಘɺCI Ͱઃఆ
݁Ռ
͍͍͜ͱ • 100% ΛݟΔͱॆ࣮ײ͕͋Δ • ͬͱΔͧ • ✅ ϨϏϡϫʔͷෛ୲ݮ •
ςετॻ͍ͯͳ͍ͷ͕ҰॠͰόϨΔ • ݾͷະख़͞Λײ͡Δ ( 43%)
͓·͚
require 'date' max = 90 diff = Date.today - Date.new(2017,3,13)
min = max > diff ? diff : max xcov.report( workspace: 'workspace', scheme: 'scheme', minimum_coverage_percentage: min) 90ޙʹ90%Λ࣮ݱ͢Δํ๏ ຖ1%ͣͭ Merge ͷਫ४Λ্͍͛ͯ͘
Ҏ্