Resolve "Investigate long running examples in frontend fixture rspec"
What does this MR do?
Optimize frontend fixtures specs by using let_it_be
.
This makes the frontend fixtures generation 6 minutes faster (from 15 minutes to 9 minutes):
- that's a 82% duration improvement for the fixtures generation itself.
- that's a 40% duration decrease for the
frontend-fixtures
job. -
frontend-fixtures-as-if-foss
duration doesn't change.
Before
Finished in 7 minutes 51 seconds (files took 49.38 seconds to load)
85 examples, 0 failures
After
Top 10 slowest examples (18.26 seconds, 21.2% of total time):
Epics (JavaScript fixtures) IssuablesHelper (JavaScript fixtures) epic/mock_data.json
4.11 seconds ./ee/spec/frontend/fixtures/epic.rb:59
API::Issues (JavaScript fixtures) issues/related_merge_requests.json
2.41 seconds ./spec/frontend/fixtures/issues.rb:101
Projects::IssuesController (JavaScript fixtures) ee/issues/blocked-issue.html
1.88 seconds ./ee/spec/frontend/fixtures/issues.rb:28
Projects (JavaScript fixtures) ProjectsController (JavaScript fixtures) projects/overview.html
1.72 seconds ./spec/frontend/fixtures/projects.rb:43
Projects::MergeRequestsController (JavaScript fixtures) merge_requests/merge_request_of_current_user.html
1.52 seconds ./spec/frontend/fixtures/merge_requests.rb:65
Projects::MergeRequestsController (JavaScript fixtures) merge_requests/diff_comment.html
1.39 seconds ./spec/frontend/fixtures/merge_requests.rb:85
Projects::MergeRequests::DiffsController (JavaScript fixtures) merge_request_diffs/parallel_changes_tab_with_comments.json
1.37 seconds ./spec/frontend/fixtures/merge_requests_diffs.rb:49
Projects::MergeRequestsController (JavaScript fixtures) merge_requests/merge_request_with_task_list.html
1.31 seconds ./spec/frontend/fixtures/merge_requests.rb:71
Projects::BoardsController (JavaScript fixtures) boards/show.html
1.28 seconds ./spec/frontend/fixtures/boards.rb:22
Projects::MergeRequestsController (JavaScript fixtures) merge_requests/merge_request_with_comment.html
1.26 seconds ./spec/frontend/fixtures/merge_requests.rb:91
Top 10 slowest example groups:
API::Issues (JavaScript fixtures)
2.57 seconds average (2.57 seconds / 1 example) ./spec/frontend/fixtures/issues.rb:78
Epics (JavaScript fixtures)
2.4 seconds average (4.81 seconds / 2 examples) ./ee/spec/frontend/fixtures/epic.rb:5
Projects::IssuesController (JavaScript fixtures)
2.19 seconds average (2.19 seconds / 1 example) ./ee/spec/frontend/fixtures/issues.rb:5
Projects::BlobController (JavaScript fixtures)
1.69 seconds average (1.69 seconds / 1 example) ./spec/frontend/fixtures/blob.rb:5
Groups::SamlProvidersController (JavaScript fixtures)
1.64 seconds average (1.64 seconds / 1 example) ./ee/spec/frontend/fixtures/saml_providers.rb:4
Projects::CommitController (JavaScript fixtures)
1.34 seconds average (1.34 seconds / 1 example) ./spec/frontend/fixtures/commit.rb:5
Projects::BoardsController (JavaScript fixtures)
1.32 seconds average (1.32 seconds / 1 example) ./spec/frontend/fixtures/boards.rb:5
Admin::ApplicationSettingsController (JavaScript fixtures)
1.31 seconds average (1.31 seconds / 1 example) ./spec/frontend/fixtures/application_settings.rb:5
Projects::DeployKeysController (JavaScript fixtures)
1.22 seconds average (1.22 seconds / 1 example) ./spec/frontend/fixtures/deploy_keys.rb:5
Projects::ClustersController (JavaScript fixtures)
1.2 seconds average (1.2 seconds / 1 example) ./spec/frontend/fixtures/clusters.rb:5
Finished in 1 minute 26.18 seconds (files took 53.53 seconds to load)
85 examples, 0 failures
Closes #207071 (closed).
Edited by Rémy Coutable