Reduce the number of backend test predictions
From Draft to Ready
-
gitlab-org/ruby/gems/test_file_finder!52 (merged) was merged and released -
!148212 (merged) is merged
Context
Closes #450374 (closed).
Implements the feature introduced in gitlab-org/ruby/gems/test_file_finder!46 (merged).
What does this MR do and why?
Reduce the number of backend test predictions for the topmost 5% of mappings only.
This is not as important for the DescribedClass
Crystalball strategy as it would have been for the Coverage
Crystalball strategy, but I think it's still useful to have it working for the top 5% cases, and in to have this mechanism available in general if we want to use other crystalball strategies, or the same strategies with different thresholds for making pipelines tiers
Proof of work
Change a file that will trigger 36 backend test files
- Expected: We will reduce the number of backend test files to run by 50%.
-
Actual:
$ cat rspec/changed_files.txt
app/models/concerns/spammable.rb
$ cat crystalball/mapping.json | jq '."app/models/concerns/spammable.rb" | length'
36
# Clean the previous results
rm -rf rspec/matching_tests*
# Run https://gitlab.com/gitlab-org/quality/engineering-productivity/team/-/blob/main/runbooks/predictive-test-selection.md#generate-test-predictions-like-detect-tests-would locally
$ cat rspec/matching_tests.txt | wc -w
18
Change a file that will trigger 10 backend test files
- Expected: We will keep the number of backend test files to 10.
-
Actual:
$ cat rspec/changed_files.txt
app/finders/issuable_finder.rb
$ cat crystalball/mapping.json | jq '."app/finders/issuable_finder.rb" | length'
10
# Clean the previous results
rm -rf rspec/matching_tests*
# Run https://gitlab.com/gitlab-org/quality/engineering-productivity/team/-/blob/main/runbooks/predictive-test-selection.md#generate-test-predictions-like-detect-tests-would locally
$ cat rspec/matching_tests.txt | wc -w
10
Merge request reports
Activity
changed milestone to %16.11
added Engineering Productivity maintenanceperformance typemaintenance + 1 deleted label
assigned to @ddieulivol
- A deleted user
added backend label
1 Message CHANGELOG missing: If this merge request needs a changelog entry, add the
Changelog
trailer to the commit message you want to add to the changelog.If this merge request doesn't need a CHANGELOG entry, feel free to ignore this message.
Reviewer roulette
Category Reviewer Maintainer backend @bhrai
(UTC+2, same timezone as author)
@drew
(UTC+0, 2 hours behind author)
~"Tooling" Reviewer review is optional for ~"Tooling" @jennli
(UTC-7, 9 hours behind author)
Please check reviewer's status!
Please refer to documentation page for guidance on how you can benefit from the Reviewer Roulette, or use the GitLab Review Workload Dashboard to find other available reviewers.
If needed, you can retry the
danger-review
job that generated this comment.Generated by
Dangeradded 1 commit
- 2f1bd1d4 - Reduce the number of backend test predictions
marked the checklist item !148212 (merged) is merged as completed
added 499 commits
-
2f1bd1d4...01f60da3 - 498 commits from branch
master
- bc47f09a - Reduce the number of backend test predictions
-
2f1bd1d4...01f60da3 - 498 commits from branch
Hey @godfat-gitlab, Could you please review this MR? Thanks in advance
requested review from @godfat-gitlab
added pipeline:mr-approved label
- Resolved by Lin Jen-Shin
@godfat-gitlab
, thanks for approving this merge request.This is the first time the merge request has been approved. To ensure we don't only run predictive pipelines, and we don't break
master
, a new pipeline will be started shortly.Please wait for the pipeline to start before resolving this discussion and set auto-merge for the new pipeline. See merging a merge request for more details.
@ddieulivol Great work, thank you! This also opens up a way to raise the limit as the merge request progresses: gitlab-org/quality/engineering-productivity/team#436 (comment 1837928663)
I am not sure how helpful that is yet (running more inaccurate tests aren't helpful, and if they're so accurate running less is probably harmful...), but something to think about
enabled an automatic merge when the pipeline for e48a58b6 succeeds
mentioned in commit 35892bd0
mentioned in issue #450374 (closed)
mentioned in incident gitlab-org/quality/engineering-productivity/master-broken-incidents#5732 (closed)
added workflowstaging-canary label
added workflowcanary label and removed workflowstaging-canary label
added workflowproduction label and removed workflowcanary label
added workflowstaging label and removed workflowproduction label
added workflowpost-deploy-db-staging label and removed workflowstaging label
added releasedcandidate label
mentioned in issue gitlab-org/quality/engineering-productivity/team#436 (closed)
added releasedpublished label and removed releasedcandidate label
added pipelinetier-3 label