Deduplicate `collect_*_reports!` methods
Summary
The current implementation of collect_*_reports!
methods have a lot of duplicated code. We should look into extracting the generic parts to improve this.
Every collect method does something a bit differently:
-
collect_test_reports!
doestest_reports.get_suite(group_name)
before populating the report -
collect_security_reports!
has different feature checks and reports depending on the security report type -
collect_license_management_reports!
andcollect_metrics_reports!
are more or less the same and can be deduplicated when we remove the feature flag checkcollect_license_management_reports!
(we already have a license feature check which should count as a feature flag as well, so I think we can remove it soon)