Created
June 19, 2018 11:20
-
-
Save niwatako/323e55627cbe900b206f74e097f15dce to your computer and use it in GitHub Desktop.
What's new In Testing #roppongiswift #CodePiece
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### こたらさん(@kotala_b) What's new In Testing | |
VISITSで働いています、4週間目。 | |
WWDCのテストセッションより | |
#### Target selection | |
Xcodeのターゲットも設定でそれぞれにコードカバレッジを出力できる、Xcode9.3から使えるようになっている。 | |
### XCCOV | |
JSON出力のサポート。コードカバレッジの詳細データが出てくる。 | |
``` | |
xcodebuild test -enableCodeCoverage YES -.... | |
``` | |
コードカバレッジのレポートファイルが出力される --json でJSON形式で出てくる。JSONで出さないと詳細なデータが出てこない。 | |
fastlaneでももう使える。 | |
result_bundle, output_directory の指定で出てくる。 | |
#### Editorの中のコードカバレッジという設定が追加されていて、 | |
XcodeEditorの右側に、テストされていないコードが赤く表示される。 | |
#### Parallel Testing | |
##### Parallel Destination Testing | |
端末を指定していくつかの端末で並行テスト実行できる、今まであったやつ | |
##### Parallel Distributed Testing | |
Xcode10から、複数のテストがあったとき、並行で実行できてテスト時間を短縮できる。 | |
普通にSimulatorが立ち上がって、Simulatorのクローンが起動して並列実行される。 | |
``` | |
-parallel-testing-worker-.... 4 | |
``` | |
Xcodeからできるのでやってみます。 | |
Cloneの起動に時間がかかるので、時間がかからない限りあまり意味がない。 | |
Simulatorを起動したまま、2度目のテストをやってみると片方クラッシュもする。 | |
RxSwiftのテストをやってみました。 | |
直列だと23s、並列にすると14s。ちゃんと動けばやる意味がありそう。 | |
#### Tips | |
実行に時間が掛かるテストはクラス単位で行われると思うので、テストクラスを分割して並列実行しやすいようにすること。パフォーマンステストは並列実行するとパフォーマンスに影響が出るのでそこは並列実行しないようにする必要がある。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment