Wikimedia Apps/Team/iOS/Engineering Pre-release Checklist

Every iOS release goes through a pre-release checklist, based on a Phabricator template ticket here. This wiki goes into further detail on what all engineering needs to do for this. Results should be pasted as a comment on the release-specific pre-release phabricator ticket as well as here if it would be useful to glance for an overall trend.

Check for retain cycles
Go over new flows in Instruments to confirm expected classes are properly deallocated.

Run static analyzer and runtime checks

 * Fix any issues surfaced from Product > Analyze. You can ignore any problems within third party libraries.
 * In the Wikipedia scheme, under Run > Diagnostics, check off Address sanitizer, detect use of stack after return, Thread sanitizer, and Undefined Behavior sanitizer. Run the app with these various settings and fix any runtime issues that crop up.
 * Main thread checker is selected by default here, so no need to explicitly test for this.
 * Run the app again with the Core Data thread checker on by adding  as a launch argument to the scheme. Run the app (including performing a migration from the last release) and fix any issues that crop up.

Record launch time
Do these steps for at least two physical devices and record the results.


 * 1) Select the Performance Testing scheme, then choose Edit Scheme and confirm the scheme runs in Release mode with "Debug executable" checked.
 * 2) When you run, you should see several of measurements printed out to the console after the app launches. Record those measurements.
 * 3) Do this for a fresh install and for upgrading from an old app with many saved articles (I choose 100 over a variety of languages).

Total pre-main time: 493.36 milliseconds (100.0%) dylib loading time: 250.78 milliseconds (50.8%) rebase/binding time: 16.17 milliseconds (3.2%) ObjC setup time: 154.93 milliseconds (31.4%) initializer time: 71.47 milliseconds (14.4%) slowest intializers : libSystem.B.dylib :  7.29 milliseconds (1.4%) libMainThreadChecker.dylib : 36.58 milliseconds (7.4%) Wikipedia : 31.25 milliseconds (6.3%)

Run manual unit tests & stub performance tests
Currently we have some manual and performance tests that are not set up to work with our build server / CI process. Until then, it's good to run these manually pre-release as a sanity check. These tests are in ArticleCacheReadingManualTests,swift, ReadingListManualPerformanceTests.swift,  ArticleManualPerformanceTests.swift,  and TalkPageManualPerformanceTests.swift. Run these on at least two devices from the Performance Testing scheme. Confirm ArticleCacheReadingManualTests run at all (will need to be on a device with no connection), and record the average run times of the performance tests. Note ArticleManualPerformanceTests.swift stub out the network call with Nocilla, so it is a true native-only performance test.

Run live tests
As a last set of performance tests, we are recording the time it takes to display article content via os_log. This is printed out in the console when you run in the Performance Testing scheme. You can also try searching via the Device log in the Console app for: process:Wikipedia subsystem:org.wikimedia.ios category:articleLoadTime

if you want to find these values without connecting to Xcode. Be sure Action > Include Info Messages is checked.

To reach this log, go to the Explore feed and search for an article. The load time is recorded from just before an article is presented, to the PCS Javascript 'setup' action that is called over the bridge informing native land that initial article loading is complete. For these tests, uncheck the "Debug executable" checkbox in the Run section of Edit Scheme for Performance Testing so that this is closer to a live run. We want to run on at least 2 devices, with a large and a small article, for a fresh install, a cached article load, and a saved article load.

Fresh install
For each device:


 * 1) Fresh install the app.
 * 2) Go to iOS Settings > Safari > Clear History and Website Data.
 * 3) Search United States on EN Wikipedia. Record time. Record result.
 * 4) Repeat steps 1-3 for Spinning Newspaper on EN Wikipedia. Record result.

Revisit
For each device, after your last article visit from fresh install (i.e. while it's still cached):


 * 1) Revisit article from Search result. Record the average.

Saved article
For each device, tap save article icon on Article for your long and short article (eg. United States and Spinning Newspaper). Then for each article:


 * 1) Go to App Settings, tap "Clear cached data"
 * 2) Go to iOS Settings > Safari > Clear History and Website Data.
 * 3) Enter airplane mode. Revisit article via Saved tab. Note result and record.