Skip to content

Fix shared examples naming

Aakriti Gupta requested to merge ag-fix-shared-examples-naming into master

What does this MR do?

2 shared examples files were ending in _spec which is the pattern Rspec looks for while loading files automatically.

Since these files were required in multiple spec files, the same files were being loaded multiple times, causing multiple definitions.

See generated warnings before

``` WARNING: Shared example group 'cycle analytics stage' has been previously defined at: /Users/aakriti/Development/my-gdk/gitlab/spec/support/shared_examples/models/cycle_analytics_stage_shared_examples.rb:3 ...and you are now defining it at: /Users/aakriti/Development/my-gdk/gitlab/spec/support/shared_examples/models/cycle_analytics_stage_shared_examples.rb:3 The new definition will overwrite the original one. WARNING: Shared example group 'cycle analytics label based stage' has been previously defined at: /Users/aakriti/Development/my-gdk/gitlab/spec/support/shared_examples/models/cycle_analytics_stage_shared_examples.rb:114 ...and you are now defining it at: /Users/aakriti/Development/my-gdk/gitlab/spec/support/shared_examples/models/cycle_analytics_stage_shared_examples.rb:114 The new definition will overwrite the original one. WARNING: Shared example group 'cycle analytics event' has been previously defined at: /Users/aakriti/Development/my-gdk/gitlab/spec/support/shared_examples/lib/gitlab/cycle_analytics_event_shared_examples.rb:3 ...and you are now defining it at: /Users/aakriti/Development/my-gdk/gitlab/spec/support/shared_examples/lib/gitlab/cycle_analytics_event_shared_examples.rb:3 The new definition will overwrite the original one. /Users/aakriti/Development/my-gdk/gitlab/spec/lib/gitlab/cycle_analytics/shared_stage_spec.rb:6: warning: already initialized constant ISSUES_MEDIAN /Users/aakriti/Development/my-gdk/gitlab/spec/lib/gitlab/cycle_analytics/shared_stage_spec.rb:6: warning: previous definition of ISSUES_MEDIAN was here /Users/aakriti/Development/my-gdk/gitlab/spec/lib/gitlab/cycle_analytics/shared_stage_spec.rb:6: warning: already initialized constant ISSUES_MEDIAN /Users/aakriti/Development/my-gdk/gitlab/spec/lib/gitlab/cycle_analytics/shared_stage_spec.rb:6: warning: previous definition of ISSUES_MEDIAN was here /Users/aakriti/Development/my-gdk/gitlab/spec/lib/gitlab/cycle_analytics/shared_stage_spec.rb:6: warning: already initialized constant ISSUES_MEDIAN /Users/aakriti/Development/my-gdk/gitlab/spec/lib/gitlab/cycle_analytics/shared_stage_spec.rb:6: warning: previous definition of ISSUES_MEDIAN was here /Users/aakriti/Development/my-gdk/gitlab/spec/lib/gitlab/cycle_analytics/shared_stage_spec.rb:6: warning: already initialized constant ISSUES_MEDIAN /Users/aakriti/Development/my-gdk/gitlab/spec/lib/gitlab/cycle_analytics/shared_stage_spec.rb:6: warning: previous definition of ISSUES_MEDIAN was here WARNING: Shared example group 'default query config' has been previously defined at: /Users/aakriti/Development/my-gdk/gitlab/spec/lib/gitlab/cycle_analytics/shared_event_spec.rb:5 ...and you are now defining it at: /Users/aakriti/Development/my-gdk/gitlab/spec/lib/gitlab/cycle_analytics/shared_event_spec.rb:5 The new definition will overwrite the original one. WARNING: Shared example group 'base stage' has been previously defined at: /Users/aakriti/Development/my-gdk/gitlab/spec/lib/gitlab/cycle_analytics/shared_stage_spec.rb:5 ...and you are now defining it at: /Users/aakriti/Development/my-gdk/gitlab/spec/lib/gitlab/cycle_analytics/shared_stage_spec.rb:5 The new definition will overwrite the original one. WARNING: Shared example group 'calculate #median with date range' has been previously defined at: /Users/aakriti/Development/my-gdk/gitlab/spec/lib/gitlab/cycle_analytics/shared_stage_spec.rb:38 ...and you are now defining it at: /Users/aakriti/Development/my-gdk/gitlab/spec/lib/gitlab/cycle_analytics/shared_stage_spec.rb:38 The new definition will overwrite the original one. WARNING: Shared example group 'Gitlab::Analytics::CycleAnalytics::DataCollector backend examples' has been previously defined at: /Users/aakriti/Development/my-gdk/gitlab/spec/lib/gitlab/cycle_analytics/shared_stage_spec.rb:58 ...and you are now defining it at: /Users/aakriti/Development/my-gdk/gitlab/spec/lib/gitlab/cycle_analytics/shared_stage_spec.rb:58 The new definition will overwrite the original one. /Users/aakriti/Development/my-gdk/gitlab/spec/lib/gitlab/cycle_analytics/shared_stage_spec.rb:6: warning: already initialized constant ISSUES_MEDIAN /Users/aakriti/Development/my-gdk/gitlab/spec/lib/gitlab/cycle_analytics/shared_stage_spec.rb:6: warning: previous definition of ISSUES_MEDIAN was here /Users/aakriti/Development/my-gdk/gitlab/spec/lib/gitlab/cycle_analytics/shared_stage_spec.rb:6: warning: already initialized constant ISSUES_MEDIAN /Users/aakriti/Development/my-gdk/gitlab/spec/lib/gitlab/cycle_analytics/shared_stage_spec.rb:6: warning: previous definition of ISSUES_MEDIAN was here Run options: include {:focus=>true} ```

This MR fixes the file names to follow the convention.

This should also shave off some test tun time. Locally it shaves off > 2 minutes!

Screenshots

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 Aakriti Gupta

Merge request reports

Loading