bluepill icon indicating copy to clipboard operation
bluepill copied to clipboard

Add logic test support

Open lthrockmorton opened this issue 2 years ago • 2 comments

Adds logic test support to Bluepill, so that unit tests can be run without an app host. Resolves #531.

Leverages CoreSimulator's private spawn method to run the xctest executable on individual logic test bundles. Doing so requires adjustments to various inputs (e.g. the xctest executable expects the list of tests in a different format) as well as different error handling (based on the nuances of how errors/crashes surface from the spawn method.

Also fixes a bug where retrying tests after a crash was being dictated by the wrong config variable (onlyRetryFailed rather than retryAppCrashTests).

Tests were added to validate:

  • happy path testing
  • sad paths (failure/timeout/crashes)
  • timeouts for both individual test cases + execution timeouts
  • retries
  • swift vs objc tests (requires name transformation for swift)
  • testing multiple test bundles

Logic test execution time data was collected and available here.

Note: should be tested with consuming app (Voyager iOS) before committing, which requires a pending change in that app first. In the mean time, this change is only internally tested.

lthrockmorton avatar Jun 15 '23 00:06 lthrockmorton

Very cool! This seems like it'd satisfy https://github.com/MobileNativeFoundation/bluepill/issues/531

dostrander avatar Jun 15 '23 11:06 dostrander

Very cool! This seems like it'd satisfy #531

Yes! Very excited to support this.

lthrockmorton avatar Jun 15 '23 18:06 lthrockmorton