diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-19 15:09:29 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-19 15:09:29 +0300 |
commit | 3ca9a972f6bc4060a58703398df74d87703916cf (patch) | |
tree | 4c10ba27bd3e079ad156f030835179a6dd4dafa8 /spec/tooling | |
parent | 76e68e67ab3e928d289361ac20558a053a623263 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/tooling')
-rw-r--r-- | spec/tooling/danger/specs/project_factory_suggestion_spec.rb | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/spec/tooling/danger/specs/project_factory_suggestion_spec.rb b/spec/tooling/danger/specs/project_factory_suggestion_spec.rb index 9b10ab1a6f4..b765d5073af 100644 --- a/spec/tooling/danger/specs/project_factory_suggestion_spec.rb +++ b/spec/tooling/danger/specs/project_factory_suggestion_spec.rb @@ -18,17 +18,16 @@ RSpec.describe Tooling::Danger::Specs::ProjectFactorySuggestion, feature_categor %<suggested_line>s ``` - Project creations are very slow. Using `let_it_be`, `build` or `build_stubbed` can improve test performance. + Project creations are very slow. To improve test performance, consider using `let_it_be`, `build`, or `build_stubbed` instead. - Warning: `let_it_be` may not be suitable if your test modifies data as this could result in state leaks! + ⚠️ **Warning**: If your test modifies data, `let_it_be` may be unsuitable, and cause state leaks! Use `let_it_be_with_reload` or `let_it_be_with_refind` instead. - In those cases, please use `let_it_be_with_reload` or `let_it_be_with_refind` instead. - - If your are unsure which is the right method to use, - please refer to [testing best practices](https://docs.gitlab.com/ee/development/testing_guide/best_practices.html#optimize-factory-usage) + Unsure which method to use? See the [testing best practices](https://docs.gitlab.com/ee/development/testing_guide/best_practices.html#optimize-factory-usage) for background information and alternative options for optimizing factory usage. - Feel free to ignore this comment if you know `let` or `let!` are the better options and/or worry about causing state leaks. + If you're concerned about causing state leaks, or if you know `let` or `let!` are the better options, ignore this comment. + + ([Improve this message?](https://gitlab.com/gitlab-org/gitlab/-/blob/master/tooling/danger/specs/project_factory_suggestion.rb)) MARKDOWN end |