Slide 1

Slide 1 text

What’s new in Testing Gio Lodi, Mobile Infrastructure @ Automattic Melbourne CocoaHeads 2021/06/10  WWDC21

Slide 2

Slide 2 text

• Xcode Cloud • async/await & test • XCTExpectFailure • Test Repetition • addTearDownBlock { }

Slide 3

Slide 3 text

Xcode Cloud So that’s what they bough BuddyBuild for…

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

• Xcode Cloud docs homepage • Supports GitHub, GitHub Enterprise, Bitbucket Cloud, Bitbucket Server, GitLab, and GitLab self-managed instances • Environment Variables CI, CI_BUILD_ID, CI_XCODE_SCHEME, CI_TEST_PLAN, CI_PULL_REQUEST_NUMBER, … • Web Hooks – Note: You can configure up to five web hooks per Xcode Cloud product.

Slide 6

Slide 6 text

Requirements for Using Xcode Cloud

Slide 7

Slide 7 text

About Continuous Integration and Delivery with Xcode Cloud

Slide 8

Slide 8 text

Review code and collaborate in Xcode

Slide 9

Slide 9 text

Review code and collaborate in Xcode

Slide 10

Slide 10 text

☁ Would you trust to do all that for you in the ?!

Slide 11

Slide 11 text

async/await ❤ unit tests Testing async code just go easier

Slide 12

Slide 12 text

https://mokacoding.com/blog/how-to-test-async-await-code-in-swift/

Slide 13

Slide 13 text

https://mokacoding.com/blog/how-to-test-async-await-code-in-swift/

Slide 14

Slide 14 text

XCTExpectFailure The best API you should never use

Slide 15

Slide 15 text

https://mokacoding.com/blog/xctexpectfailure

Slide 16

Slide 16 text

https://mokacoding.com/blog/xctexpectfailure

Slide 17

Slide 17 text

https://mokacoding.com/blog/xctexpectfailure

Slide 18

Slide 18 text

https://mokacoding.com/blog/xctexpectfailure

Slide 19

Slide 19 text

https://mokacoding.com/blog/xctexpectfailure

Slide 20

Slide 20 text

https://mokacoding.com/blog/xctexpectfailure

Slide 21

Slide 21 text

https://mokacoding.com/blog/xctexpectfailure

Slide 22

Slide 22 text

Test Repetition More tools to avoid dealing with address flaky tests

Slide 23

Slide 23 text

Diagnose unreliable code with test repetitions

Slide 24

Slide 24 text

Diagnose unreliable code with test repetitions

Slide 25

Slide 25 text

Diagnose unreliable code with test repetitions Until Failure

Slide 26

Slide 26 text

Diagnose unreliable code with test repetitions Retry on Failure

Slide 27

Slide 27 text

Diagnose unreliable code with test repetitions Up Until Maximum Repetition

Slide 28

Slide 28 text

addTearDownBlock I couldn’t find a snarky remark for this one…

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

Test-Driven Development in Swift tddinswift.com

Slide 31

Slide 31 text

One more thing…

Slide 32

Slide 32 text

Vim key bindings So you’ll never be able to quite Xcode again

Slide 33

Slide 33 text

• Vim key bindings introduce “Modal Editing” • Normal mode – Verb + Movement + Subject • Insert mode • Visual mode • Limited support (for now? $%)

Slide 34

Slide 34 text

Demo Time

Slide 35

Slide 35 text

mokacoding.com/xcode-heart-vim ❤

Slide 36

Slide 36 text

& Gio Lodi Mobile Infrastructure Engineer @ Automattic @mokagio mokacoding.com gio.codes