Skip to content
Snippets Groups Projects

Run all new backend specs in random order

Merged Peter Leitzen requested to merge pl-rspec-order into master
1 unresolved thread
Files
2
@@ -87,22 +87,21 @@ SILENCE_DEPRECATIONS=1 bin/rspec spec/models/project_spec.rb
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/93137) in GitLab 15.3.
All _new_ specs are run in [random order](https://gitlab.com/gitlab-org/gitlab/-/issues/337399)
All _new_ spec files are run in [random order](https://gitlab.com/gitlab-org/gitlab/-/issues/337399)
to surface flaky tests that are dependent test order.
For a list of spec files which are still run in defined order, see [`rspec_order_todo.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/spec/support/rspec_order_todo.yml).
To make specs run in random order:
To make spec files run in random order, check their order dependency with:
1. Check if specs fail when run in random order:
```shell
scripts/rspec_check_order_dependence spec/models/project_spec.rb
```
```shell
scripts/rspec_check_order_dependence spec/models/project_spec.rb
```
1. Fix the spec failures if needed
If they pass the check the spec files the script removes them from
[`rspec_order_todo.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/spec/support/rspec_order_todo.yml).
1. Remove checked spec files from [`rspec_order_todo.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/spec/support/rspec_order_todo.yml).
If they fail the check spec failures must be fixed.
### Test speed
Loading