Commit 70cfff2a authored by Evan Read's avatar Evan Read

Merge branch 'parallel-docs-sempahore-example' into 'master'

Documentation: Added Semaphore Test Boosters example to CI YAML `parallel` docs

Closes #63509

See merge request gitlab-org/gitlab-ce!31067
parents 0b975947 afa73f4d
...@@ -1771,18 +1771,41 @@ sequentially from `job_name 1/N` to `job_name N/N`. ...@@ -1771,18 +1771,41 @@ sequentially from `job_name 1/N` to `job_name N/N`.
For every job, `CI_NODE_INDEX` and `CI_NODE_TOTAL` [environment variables](../variables/README.md#predefined-environment-variables) are set. For every job, `CI_NODE_INDEX` and `CI_NODE_TOTAL` [environment variables](../variables/README.md#predefined-environment-variables) are set.
A simple example: Marking a job to be run in parallel requires only a simple addition to your configuration file:
```yaml ```diff
test: test:
script: rspec script: rspec
parallel: 5 + parallel: 5
``` ```
TIP: **Tip:** TIP: **Tip:**
Parallelize tests suites across parallel jobs. Parallelize tests suites across parallel jobs.
Different languages have different tools to facilitate this. Different languages have different tools to facilitate this.
A simple example using [Sempahore Test Boosters](https://github.com/renderedtext/test-boosters) and RSpec to run some Ruby tests:
```ruby
# Gemfile
source 'https://rubygems.org'
gem 'rspec'
gem 'semaphore_test_boosters'
```
```yaml
test:
parallel: 3
script:
- bundle
- bundle exec rspec_booster --job $CI_NODE_INDEX/$CI_NODE_TOTAL
```
CAUTION: **Caution:**
Please be aware that semaphore_test_boosters reports usages statistics to the author.
You can then navigate to the **Jobs** tab of a new pipeline build and see your RSpec
job split into three separate jobs.
### `trigger` **(PREMIUM)** ### `trigger` **(PREMIUM)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/issues/8997) in [GitLab Premium](https://about.gitlab.com/pricing/) 11.8. > [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/issues/8997) in [GitLab Premium](https://about.gitlab.com/pricing/) 11.8.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment