Improve projects configuration presenter specs
What does this MR do and why?
Describe in detail what your merge request does and why.
Related #374507 (closed)
The total running time of ./spec/presenters/projects/security/configuration_presenter_spec.rb is 97.93 seconds and it executes 9131 queries. It is likely this can be improved. Please review this suite or example for opportunities to fix slow tests.
Before
Finished in 3 minutes 12.7 seconds (files took 8.57 seconds to load)
70 examples, 0 failures
[TEST PROF INFO] Time spent in factories: 02:53.000 (89.51% of total time)
[TEST PROF INFO] Factories usage
Total: 427
Total top-level: 357
Total time: 02:53.000 (out of 03:17.621)
Total uniq factories: 6
total top-level total time time per call top-level time name
162 162 2.7168s 0.0168s 2.7168s ci_build
70 70 164.8855s 2.3555s 164.8855s project
70 0 5.5310s 0.0790s 0.0000s namespace
70 70 4.4099s 0.0630s 4.4099s user
54 54 0.9816s 0.0182s 0.9816s ci_pipeline
1 1 0.0069s 0.0069s 0.0069s license
After
Finished in 1 minute 1.84 seconds (files took 7.96 seconds to load)
70 examples, 0 failures
[TEST PROF INFO] Time spent in factories: 00:47.829 (76.66% of total time)
[TEST PROF INFO] Factories usage
Total: 215
Total top-level: 196
Total time: 00:47.829 (out of 01:06.705)
Total uniq factories: 5
total top-level total time time per call top-level time name
162 162 2.4447s 0.0151s 2.4447s ci_build
19 19 44.9068s 2.3635s 44.9068s project
19 0 1.3989s 0.0736s 0.0000s namespace
14 14 0.4725s 0.0337s 0.4725s ci_pipeline
1 1 0.0056s 0.0056s 0.0056s license
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Nikola Milojevic