Fix remaining EE offenses for FactoryBot/InlineAssociation [RUN ALL RSPEC]
What does this MR do?
This MR removes the remaining FactoryBot/InlineAssociation.
Contributes to #267606 (closed).
RSpec Profiling
Here's the output from test-prof
when run with FPROF=1
. Note:
-
Total amount
of factories created went down from 48 to 4🚀 -
Total events
went down from 1252 to 386 - Queries saved: 866
Before
[TEST PROF INFO] FactoryDoctor enabled (event: "sql.active_record", threshold: 0.01)
[TEST PROF INFO] FactoryProf enabled (simple mode)
Run options: include {:focus=>true}
All examples were filtered out; ignoring {:focus=>true}
[TEST PROF INFO] EventProf enabled (sql.active_record)
..................[TEST PROF INFO] FactoryDoctor report
Total (potentially) bad examples: 3
Total wasted time: 00:00.152
Vulnerabilities::FeedbackEntity (./ee/spec/serializers/vulnerabilities/feedback_entity_spec.rb:5) (4 records created, 00:00.152)
does not include fields related to current user (./ee/spec/serializers/vulnerabilities/feedback_entity_spec.rb:57) – 2 records created, 00:00.092
does not expose issue information (./ee/spec/serializers/vulnerabilities/feedback_entity_spec.rb:67) – 1 record created, 00:00.041
does not expose merge request information (./ee/spec/serializers/vulnerabilities/feedback_entity_spec.rb:112) – 1 record created, 00:00.018
[TEST PROF INFO] EventProf results for sql.active_record
Total time: 00:02.210 of 00:05.407 (40.87%)
Total events: 1252
Top 5 slowest suites (by time):
Vulnerabiliti...FeedbackEntity (./ee/spec/serializers/vulnerabilities/feedback_entity_spec.rb:5) – 00:02.210 (1252 / 18) of 00:05.407 (40.87%)
Finished in 14.02 seconds (files took 13.49 seconds to load)
18 examples, 0 failures
[TEST PROF INFO] Factories usage
Total: 48
Total top-level: 33
Total time: 4.1348s
Total uniq factories: 12
total top-level total time time per call top-level time name
18 15 0.5394s 0.0300s 0.4697s ci_pipeline
7 7 0.6812s 0.0973s 0.6812s issue
4 1 1.2734s 0.3183s 0.7769s project
4 0 0.1754s 0.0438s 0.0000s namespace
4 4 0.5575s 0.1394s 0.5575s merge_request
3 3 0.7275s 0.2425s 0.7275s vulnerability_feedback
3 0 0.6359s 0.2120s 0.0000s author
1 1 0.0097s 0.0097s 0.0097s license
1 1 0.3309s 0.3309s 0.3309s user
1 1 0.5813s 0.5813s 0.5813s vulnerabilities_finding
1 0 0.2319s 0.2319s 0.0000s vulnerabilities_identifier
1 0 0.1597s 0.1597s 0.0000s vulnerabilities_scanner
After
[TEST PROF INFO] FactoryDoctor enabled (event: "sql.active_record", threshold: 0.01)
[TEST PROF INFO] FactoryProf enabled (simple mode)
Run options: include {:focus=>true}
All examples were filtered out; ignoring {:focus=>true}
[TEST PROF INFO] EventProf enabled (sql.active_record)
..................[TEST PROF INFO] FactoryDoctor says: "Looks good to me!"
[TEST PROF INFO] EventProf results for sql.active_record
Total time: 00:00.846 of 00:03.100 (27.3%)
Total events: 386
Top 5 slowest suites (by time):
Vulnerabiliti...FeedbackEntity (./ee/spec/serializers/vulnerabilities/feedback_entity_spec.rb:5) – 00:00.846 (386 / 18) of 00:03.100 (27.3%)
Finished in 12.07 seconds (files took 12.85 seconds to load)
18 examples, 0 failures
[TEST PROF INFO] Factories usage
Total: 4
Total top-level: 3
Total time: 1.2970s
Total uniq factories: 4
total top-level total time time per call top-level time name
1 1 0.0119s 0.0119s 0.0119s license
1 1 0.4018s 0.4018s 0.4018s user
1 1 0.8833s 0.8833s 0.8833s project
1 0 0.0575s 0.0575s 0.0000s namespace
Does this MR meet the acceptance criteria?
Conformity
-
📋 Does this MR need a changelog?- [-] I have included a changelog entry.
-
I have not included a changelog entry because developer-facing.
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
-
Separation of EE specific content
Edited by Peter Leitzen