Currently supported use cases for the iOS platform
We have prepared some Pipeline recipes based on common iOS use cases. These contain some of the most frequent tasks our users need to run.
(iOS) Run tests in parallel on multiple simulatorsClick to copy link
DescriptionClick to copy link
This example uses the sample-swift-project-with-parallel-ui-test iOS Open Source sample app, which has some example Unit and UI tests and uses Test Plans to group the tests.
The example Pipeline config showcases how to run all the test cases of the project on different iOS simulators.
run_tests_on_simulators Pipeline runs two Stages sequentially:
-
build_tests stagethat runs thebuild_testsWorkflow. This Workflow git clones the sample project and runs thexcode-build-for-testStep to build the target and associated tests. The built test bundle is transferred to the next Stage (run_tests_on_simulators) via thedeploy-to-bitrise-ioStep.The build test bundle is compressedxcode-build-for-testStep compresses the built test bundle and moves the generated zip to the $BITRISE_DEPLOY_DIR. That directory’s content is deployed to the Workflow artifacts by default via thedeploy-to-bitrise-ioStep.Artifact file size limitationThere is no limitation on the number of files deployed to Artifacts per build. There is a limitation, however, on the file size which is 2GB per file.
-
run_tests_on_simulatorsStage runs three Workflows in parallel:run_tests_iPad,run_tests_iPhone, andrun_tests_iPod. Both of these Workflows use the newxcode-test-without-buildingStep, which executes the tests based on the previous stage built test bundle. The pre-built test bundle is pulled by the_pull_test_bundleutility Workflow.
InstructionsClick to copy link
To test the configuration in a new Bitrise example project, do the following:
- Visit the Create New App page to create a new App.
- When prompted to select a git repository, choose Other/Manual and paste the sample project repository URL (
https://github.com/bitrise-io/sample-swift-project-with-parallel-ui-test) in the Git repository (clone) URL field. - Confirm that this is a public repository in the resulting pop-up.
- Select the
masterbranch to scan. - Wait for the project scanner to complete.
- Select any of the offered Distribution methods (for example development, it does not really matter as now we are focusing on testing).
- Confirm the offered stack, skip choosing the app icon and the webhook registration and kick off the first build.
- Open the new Bitrise project’s Workflow Editor.
- Go to the bitrise.yml tab and replace the existing
bitrise.ymlwith the contents of the example[bitrise.yml](https://github.com/bitrise-io/workflow-recipes/blob/main/recipes/ios-run-tests-in-parallel-on-multiple-simulators.md#bitriseyml)file. - Click the Start/Schedule a Build button, and select the run_tests_on_simulators option in the “Workflow, Pipeline” dropdown menu at the bottom of the popup.
bitrise.ymlClick to copy link
(iOS) Run test groups in parallelClick to copy link
DescriptionClick to copy link
This example uses the sample-swift-project-with-parallel-ui-test iOS Open Source sample app, which has some example Unit and UI tests and uses Test Plans to group the tests.
Xcode Test Plans provide a way to run a collection of tests with different test configurations. raywenderlich.com has a great tutorial on how to get started with Xcode Test Plans.
The example Pipeline config showcases how to run different test groups in parallel.
run_tests_groups Pipeline runs two Stages sequentially:
-
build_testsStage that runs thebuild_testsWorkflow. This Workflow git clones the sample project and runs thexcode-build-for-testStep to build the target and associated tests. The built test bundle is transferred to the next Stage (run_tests_groups) via thedeploy-to-bitrise-ioStep. -
run_tests_groupsStage runs two Workflows in parallel:run_ui_testsandrun_unit_tests. Both of these Workflows use the new xcode-test-without-buildingStep, which executes the tests based on the previous Stage built test bundle. The pre-built test bundle is pulled by the_pull_test_bundleutility Workflow.
InstructionsClick to copy link
- Visit the Create New App page to create a new App.
- When prompted to select a git repository, choose Other/Manual and paste the sample project repository URL (
https://github.com/bitrise-io/sample-swift-project-with-parallel-ui-test) in the Git repository (clone) URL field. - Confirm that this is a public repository in the resulting pop-up.
- Select the
masterbranch to scan. - Wait for the project scanner to complete.
- Select any of the offered Distribution methods (for example development, it does not really matter as now we are focusing on testing).
- Confirm the offered stack, skip choosing the app icon and the webhook registration and kick off the first build.
- Open the new Bitrise project’s Workflow Editor.
- Go to the bitrise.yml tab and replace the existing
bitrise.ymlwith the contents of the example[bitrise.yml](https://github.com/bitrise-io/workflow-recipes/blob/main/recipes/ios-run-test-groups-in-parallel.md#bitriseyml)file. - Click the Start/Schedule a Build button, and select the
run_tests_groupsoption in the “Workflow, Pipeline” dropdown menu at the bottom of the popup.
bitrise.ymlClick to copy link
GitHub link: https://github.com/bitrise-io/workflow-recipes/blob/main/recipes/ios-run-test-groups-in-parallel.md#bitriseyml