Increase issues api spec performance by decreasing factory usage
requested to merge 335939-add-support-for-started-and-upcoming-milestone-filtering-to-issues-and-mr-rest-apis into master
What does this MR do?
-
Replaces
let
s withlet_it_be
s (small refactors to accomodate this change) to improve test performance.TEST PROF report (before):
[TEST PROF INFO] Factories usage Total: 1203 Total top-level: 1199 Total time: 38.8375s Total uniq factories: 17 total top-level total time time per call top-level time name 340 340 15.0944s 0.0444s 15.0944s issue 178 178 0.6430s 0.0036s 0.6430s label_link 152 152 7.8638s 0.0517s 7.8638s closed_issue 152 152 1.1235s 0.0074s 1.1235s personal_access_token 151 151 3.4316s 0.0227s 3.4316s milestone 150 150 4.2541s 0.0284s 4.2541s note_on_issue 32 32 1.6395s 0.0512s 1.6395s user 17 17 0.2170s 0.0128s 0.2170s label 9 8 3.0725s 0.3414s 2.3899s merge_request 8 7 1.3488s 0.1686s 1.0766s project 5 5 0.1869s 0.0374s 0.1869s assignee 3 3 0.1364s 0.0455s 0.1364s award_emoji 2 0 0.1097s 0.0549s 0.0000s namespace 1 1 0.0299s 0.0299s 0.0299s incident 1 1 0.7001s 0.7001s 0.7001s merge_requests_closing_issues 1 1 0.0405s 0.0405s 0.0405s author 1 1 0.0103s 0.0103s 0.0103s license
TEST PROF report (after):
[TEST PROF INFO] Factories usage Total: 297 Total top-level: 293 Total time: 8.5905s Total uniq factories: 17 total top-level total time time per call top-level time name 152 152 1.2262s 0.0081s 1.2262s personal_access_token 45 45 1.6970s 0.0377s 1.6970s issue 29 29 0.1002s 0.0035s 0.1002s label_link 17 17 0.9152s 0.0538s 0.9152s user 17 17 0.1306s 0.0077s 0.1306s label 9 8 2.7367s 0.3041s 2.2618s merge_request 8 7 1.1897s 0.1487s 1.0337s project 5 5 0.1802s 0.0360s 0.1802s assignee 3 3 0.1613s 0.0538s 0.1613s award_emoji 3 3 0.2166s 0.0722s 0.2166s closed_issue 2 0 0.0776s 0.0388s 0.0000s namespace 2 2 0.0630s 0.0315s 0.0630s milestone 1 1 0.0364s 0.0364s 0.0364s note_on_issue 1 1 0.0361s 0.0361s 0.0361s incident 1 1 0.4856s 0.4856s 0.4856s merge_requests_closing_issues 1 1 0.0358s 0.0358s 0.0358s author 1 1 0.0109s 0.0109s 0.0109s license
Does this MR meet the acceptance criteria?
Conformity
-
I have included changelog trailers, or none are needed. (Does this MR need a changelog?) -
I have added/updated documentation, or it's not needed. (Is documentation required?) -
I have properly separated EE content from FOSS, or this MR is FOSS only. (Where should EE code go?) -
I have added information for database reviewers in the MR description, or it's not needed. (Does this MR have database related changes?) -
I have self-reviewed this MR per code review guidelines. -
This MR does not harm performance, or I have asked a reviewer to help assess the performance impact. (Merge request performance guidelines) -
I have followed the style guides. -
This change is backwards compatible across updates, or this does not apply.
Availability and Testing
-
I have added/updated tests following the Testing Guide, or it's not needed. (Consider all test levels. See the Test Planning Process.) -
I have tested this MR in all supported browsers, or it's not needed. -
I have informed the Infrastructure department of a default or new setting change per definition of done, or it's not needed.
Security
Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by euko