Skip to content

Improve usage_data monthly specs

What does this MR do?

Improve timing of usage data specs for system_usage_data_monthly

Create only necessary objects for tests

Outcome

Before


➜  gitlab git:(master) rspec  spec/lib/gitlab/usage_data_spec.rb:592
Run options: include {:focus=>true, :locations=>{"./spec/lib/gitlab/usage_data_spec.rb"=>[592]}}
WARNING: Active Record does not support composite primary key.

project_authorizations has composite primary key. Composite primary key is ignored.
.

Finished in 9.46 seconds (files took 30.67 seconds to load)
1 example, 0 failures

After


➜  gitlab git:(am-improve-usage-data-system_usage_data_monthly-specs) ✗ rspec  spec/lib/gitlab/usage_data_spec.rb:592
Run options: include {:focus=>true, :locations=>{"./spec/lib/gitlab/usage_data_spec.rb"=>[592]}}
WARNING: Active Record does not support composite primary key.

project_authorizations has composite primary key. Composite primary key is ignored.
.

Finished in 5.61 seconds (files took 28.81 seconds to load)
1 example, 0 failures

Screenshots (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

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 Alina Mihaila

Merge request reports