提交 70cfff2a 编写于 作者: E 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
......@@ -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.
A simple example:
Marking a job to be run in parallel requires only a simple addition to your configuration file:
```yaml
test:
script: rspec
parallel: 5
```diff
test:
script: rspec
+ parallel: 5
```
TIP: **Tip:**
Parallelize tests suites across parallel jobs.
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)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ee/issues/8997) in [GitLab Premium](https://about.gitlab.com/pricing/) 11.8.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册