Skip to content

Commit

Permalink
Update pipeline recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
tothszabi committed Jan 2, 2025
1 parent 32cc0d5 commit e4bbf6c
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 87 deletions.
11 changes: 3 additions & 8 deletions recipes/android-parallel-testing-unit-test-shards.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Running the unit tests of a modularized app in parallel Workflows utilizing Pipelines.

This Pipeline contains one Stage — `stage_unit_test` — that executes two Workflows in parallel:
This Pipeline contains two Workflows which are executed in parallel:

1. `unit_test_app`: This Workflow runs the unit tests of the `app` module using the `android-unit-test` Step.
1. `unit_test_library`: This Workflow runs the unit tests of the `lib-example` module using the `android-unit-test` Step.
Expand Down Expand Up @@ -41,14 +41,9 @@ meta:

pipelines:
pipeline_unit_test:
stages:
- stage_unit_test: {}

stages:
stage_unit_test:
workflows:
- unit_test_app: {}
- unit_test_library: {}
unit_test_app: {}
unit_test_library: {}

workflows:
unit_test_app:
Expand Down
Binary file modified recipes/android-parallel-testing-unit-test-shards.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 11 additions & 17 deletions recipes/android-parallel-ui-tests-on-multiple-devices.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

Running the UI or instrumented tests of a single module in parallel Workflows utilizing Pipelines. You can run the tests in parallel by shards or by devices.

The Pipeline contains two Stages that are run serially:
The Pipeline's four Workflows can be split into two logical groups:

1. `build_tests`: This Stage executes a Workflow — named `build_for_ui_testing` — that runs the `android-build-for-ui-testing` Step to build APKs for use in testing, and runs the `deploy-to-bitrise-io` Step to save those APKs for use in the later Stages. Performing this Stage separately from the actual testing allows for each test Stage to use these pre-built APKs rather than having to rebuild them for each test Stage.
1. `run_tests`: This Stage executes three UI test Workflows in parallel — `ui_test_on_phone`, `ui_test_on_tablet`, `ui_test_on_foldable` — which use the `android-instrumented-test` Step to run the UI tests on the APKs built in the previous Worflow on each specific device type.
1. Build tests: First a single Workflow is executed — named `build_for_ui_testing` — that runs the `android-build-for-ui-testing` Step to build APKs for use in testing, and runs the `deploy-to-bitrise-io` Step to save those APKs for use in the later Workflows. Running this Workflow separately from the actual testing allows for each test Workflow to use these pre-built APKs rather than having to rebuild them for each test.
1. Run tests: Then three UI test Workflows are executed in parallel — `ui_test_on_phone`, `ui_test_on_tablet`, `ui_test_on_foldable` — which use the `android-instrumented-test` Step to run the UI tests on the APKs built in the previous Worflow on each specific device type.

![A screenshot of the example Pipeline in Bitrise's web UI](./android-parallel-ui-tests-on-multiple-devices.png)

Expand Down Expand Up @@ -41,20 +41,14 @@ meta:

pipelines:
ui_test_on_multiple_devices:
stages:
- build_tests: {}
- run_rests: {}

stages:
build_tests:
workflows:
- build_for_ui_testing: {}

run_rests:
workflows:
- ui_test_on_phone: {}
- ui_test_on_tablet: {}
- ui_test_on_foldable: {}
build_for_ui_testing: {}
ui_test_on_phone:
depends_on: [build_for_ui_testing]
ui_test_on_tablet:
depends_on: [build_for_ui_testing]
ui_test_on_foldable:
depends_on: [build_for_ui_testing]

workflows:
build_for_ui_testing:
Expand Down Expand Up @@ -98,7 +92,7 @@ workflows:
steps:
- pull-intermediate-files@1:
inputs:
- artifact_sources: build_tests.build_for_ui_testing
- artifact_sources: build_for_ui_testing

_run_tests:
steps:
Expand Down
Binary file modified recipes/android-parallel-ui-tests-on-multiple-devices.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 3 additions & 8 deletions recipes/android-parallel-unit-and-ui-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Running unit tests and UI tests in parallel utilizing Pipelines.

This Pipeline contains one Stage — `stage_unit_and_ui_test` — that executes two Workflows in parallel:
This Pipeline contains two Workflows which are executed in parallel:

1. `unit_tests`: This Workflow simply runs the unit tests of the given module and variant using the `android-unit-test` Step.
1. `ui_tests`: This Workflow builds the given module and variant using the `android-build-for-ui-testing` Step, spins up an emulator using the `avd-manager` Step, waits for the emulator to boot using the `wait-for-android-emulator` Step, and runs the UI tests using the `android-instrumented-test` Step.
Expand Down Expand Up @@ -41,14 +41,9 @@ meta:

pipelines:
pipeline_unit_and_ui_test:
stages:
- stage_unit_and_ui_test: {}

stages:
stage_unit_and_ui_test:
workflows:
- unit_tests: {}
- ui_tests: {}
unit_tests: {}
ui_tests: {}

workflows:
unit_tests:
Expand Down
Binary file modified recipes/android-parallel-unit-and-ui-tests.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ This example uses the [sample-swift-project-with-parallel-ui-test](https://githu

`run_ui_tests` and `run_unit_tests` Workflows are extended with a `deploy-to-bitrise-io` Step to make the generated test results available for the next Stage.

`build_and_run_tests` Pipeline is extended with a new Stage: `deploy_test_results`.
`build_and_run_tests` Pipeline is extended with a new workflow: `deploy_test_results`.

This Stage runs the `deploy_test_results` Workflow:
This Workflow does the following:
1. `pull-intermediate-files` Step downloads the previous stage (`run_tests`) generated test results.
1. `script` Step moves each test result into a new test run directory within the Test Report add-on deploy dir and creates the related `test-info.json` file.
1. `deploy-to-bitrise-io` Step deploys the merged test results.
Expand Down Expand Up @@ -53,24 +53,14 @@ meta:

pipelines:
build_and_run_tests:
stages:
- build_tests: {}
- run_tests: {}
- deploy_test_results: {}

stages:
build_tests:
workflows:
- xcode_build_for_test: {}

run_tests:
workflows:
- run_ui_tests: {}
- run_unit_tests: {}

deploy_test_results:
workflows:
- merge_and_deploy_test_results: {}
xcode_build_for_test: {}
run_ui_tests:
depends_on: [xcode_build_for_test]
run_unit_tests:
depends_on: [xcode_build_for_test]
merge_and_deploy_test_results:
depends_on: [run_ui_tests, run_unit_tests]

workflows:
xcode_build_for_test:
Expand Down Expand Up @@ -111,7 +101,7 @@ workflows:
steps:
- pull-intermediate-files@1:
inputs:
- artifact_sources: run_tests\..*
- artifact_sources: .*
- script@1:
inputs:
- content: |
Expand Down Expand Up @@ -140,5 +130,5 @@ workflows:
steps:
- pull-intermediate-files@1:
inputs:
- artifact_sources: build_tests.xcode_build_for_test
- artifact_sources: xcode_build_for_test
```
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 9 additions & 16 deletions recipes/ios-run-test-groups-in-parallel.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ This example uses the [sample-swift-project-with-parallel-ui-test](https://githu

The example Pipeline config showcases how to run different test groups in parallel.

`build_and_run_tests` pipeline runs two Stages sequentially:
1. `build_tests` Stage that runs the `xcode_build_for_test` Workflow. This Workflow git clones the sample project and runs the `xcode-build-for-test` Step to build the target and associated tests. The built test bundle is transferred to the next Stage (`run_tests`) via the `deploy-to-bitrise-io` Step.
1. `run_tests` Stage runs two Workflows in parallel: `run_ui_tests` and `run_unit_tests`. Both of these Workflows use the new `xcode-test-without-building` Step, which executes the tests based on the previous Stage built test bundle. The pre-built test bundle is pulled by the `_pull_test_bundle` utility Workflow.
`build_and_run_tests` pipeline's Workflows can be split into two logical groups:
1. Build tests: The `xcode_build_for_test` Workflow git clones the sample project and runs the `xcode-build-for-test` Step to build the target and associated tests. The built test bundle is shared with the following Workflows via the `deploy-to-bitrise-io` Step.
1. Run tests: Then two Workflows run in parallel: `run_ui_tests` and `run_unit_tests`. Both of these Workflows use the new `xcode-test-without-building` Step, which executes the tests based on the previous Workflow built test bundle. The pre-built test bundle is pulled by the `_pull_test_bundle` utility Workflow.

![A screenshot of the example Pipeline in Bitrise's web UI](./ios-run-test-groups-in-parallel.png)

Expand Down Expand Up @@ -48,19 +48,12 @@ meta:

pipelines:
build_and_run_tests:
stages:
- build_tests: {}
- run_tests: {}

stages:
build_tests:
workflows:
- xcode_build_for_test: {}

run_tests:
workflows:
- run_ui_tests: {}
- run_unit_tests: {}
xcode_build_for_test: {}
run_ui_tests:
depends_on: [xcode_build_for_test]
run_unit_tests:
depends_on: [xcode_build_for_test]

workflows:
xcode_build_for_test:
Expand Down Expand Up @@ -95,5 +88,5 @@ workflows:
steps:
- pull-intermediate-files@1:
inputs:
- artifact_sources: build_tests.xcode_build_for_test
- artifact_sources: xcode_build_for_test
```
Binary file modified recipes/ios-run-test-groups-in-parallel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 11 additions & 17 deletions recipes/ios-run-tests-in-parallel-on-multiple-simulators.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ This example uses the [sample-swift-project-with-parallel-ui-test](https://githu

The example Pipeline config showcases how to run all the test cases of the project on different iOS simulators.

`build_and_run_tests` Pipeline runs two Stages sequentially:
1. `build_tests` Stage that runs the `xcode_build_for_test` Workflow. This Workflow git clones the sample project and runs the `xcode-build-for-test` Step to build the target and associated tests. The built test bundle is transferred to the next Stage (`run_tests_on_simulators`) via the `deploy-to-bitrise-io` Step.
`build_and_run_tests` pipeline's Workflows can be split into two logical groups:
1. Build tests: The `xcode_build_for_test` Workflow git clones the sample project and runs the `xcode-build-for-test` Step to build the target and associated tests. The built test bundle is shared with the other workflows via the `deploy-to-bitrise-io` Step.

**Note**: `xcode-build-for-test` Step 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 the `deploy-to-bitrise-io` Step.

1. `run_tests` Stage runs three Workflows in parallel: `run_tests_on_iPhone`, `run_tests_on_iPad`, and `run_tests_on_iPod`. Both of these Workflows use the new `xcode-test-without-building` Step, which executes the tests based on the previous Stage built test bundle. The pre-built test bundle is pulled by the `_pull_test_bundle` utility Workflow.
1. Run tests: Three Workflows are exsted in parallel: `run_tests_on_iPhone`, `run_tests_on_iPad`, and `run_tests_on_iPod`. All of these Workflows use the new `xcode-test-without-building` Step, which executes the tests based on the previous Stage built test bundle. The pre-built test bundle is pulled by the `_pull_test_bundle` utility Workflow.

![A screenshot of the example Pipeline in Bitrise's web UI](./ios-run-tests-in-parallel-on-multiple-simulators.png)

Expand Down Expand Up @@ -49,20 +49,14 @@ meta:

pipelines:
build_and_run_tests:
stages:
- build_tests: {}
- run_tests: {}

stages:
build_tests:
workflows:
- xcode_build_for_test: {}

run_tests:
workflows:
- run_tests_on_iPhone: {}
- run_tests_on_iPad: {}
- run_tests_on_iPod: {}
xcode_build_for_test: {}
run_tests_on_iPhone:
depends_on: [xcode_build_for_test]
run_tests_on_iPad:
depends_on: [xcode_build_for_test]
run_tests_on_iPod:
depends_on: [xcode_build_for_test]

workflows:
xcode_build_for_test:
Expand Down Expand Up @@ -106,5 +100,5 @@ workflows:
steps:
- pull-intermediate-files@1:
inputs:
- artifact_sources: build_tests.xcode_build_for_test
- artifact_sources: xcode_build_for_test
```
Binary file modified recipes/ios-run-tests-in-parallel-on-multiple-simulators.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e4bbf6c

Please sign in to comment.