Refactor coverage badge spec
What does this MR do?
This MR refactors the Coverage badge spec to be more aligned to the actual public API of the class, and removes some unnecessary work that was effectively testing parts of the Pipeline model that are redundant here.
In addition to being faster, the spec should be much easier to read and understand now.
Screenshots (strongly suggested)
Before
Finished in 9.27 seconds (files took 41.86 seconds to load)
10 examples, 0 failures
[TEST PROF INFO] Factories usage
Total: 37
Total top-level: 27
Total time: 3.7436s
Total uniq factories: 5
total top-level total time time per call top-level time name
10 10 2.7881s 0.2788s 2.7881s project
10 0 0.6493s 0.0649s 0.0000s namespace
9 9 0.6612s 0.0735s 0.6612s ci_build
7 7 0.2832s 0.0405s 0.2832s ci_pipeline
1 1 0.0111s 0.0111s 0.0111s license
After
Finished in 5.74 seconds (files took 43.95 seconds to load)
8 examples, 0 failures
[TEST PROF INFO] Factories usage
Total: 6
Total top-level: 5
Total time: 0.8988s
Total uniq factories: 5
total top-level total time time per call top-level time name
2 2 0.2862s 0.1431s 0.2862s ci_build
1 1 0.0139s 0.0139s 0.0139s license
1 1 0.5281s 0.5281s 0.5281s project
1 0 0.1212s 0.1212s 0.0000s namespace
1 1 0.0706s 0.0706s 0.0706s ci_pipeline
For readability, I recommend viewing the old and new versions of the spec file separately, as opposed to a combined diff.
This MR contains !46347 (merged), which should merge first. The changes for review in this MR are all solely in the spec file.
Does this MR meet the acceptance criteria?
Conformity
Changelog entryDocumentation (if required)-
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
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 drew stachon