1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318
|
mapping:
# EE/FOSS app should map to respective spec
- source: '(?<prefix>ee/)?app/(?<rest>.+)\.rb'
test: '%{prefix}spec/%{rest}_spec.rb'
# EE extension should also map to its FOSS class spec
- source: 'ee/app/(?<directory>.*/)ee/(?<rest>.+)\.rb'
test:
- 'spec/%{directory}%{rest}_spec.rb'
# Some EE extensions also map to its EE class spec, but this is not recommended:
# https://docs.gitlab.com/ee/development/ee_features.html#testing-ee-features-based-on-ce-features
- 'ee/spec/%{directory}%{rest}_spec.rb'
# EE/FOSS lib should map to respective spec
- source: '(?<prefix>ee/)?lib/(?<rest>.+)\.rb'
test: '%{prefix}spec/lib/%{rest}_spec.rb'
# Map rake tasks to its respective specs
- source: '(?<prefix>ee/)?lib/tasks/(?<rest>.+)\.rake'
test: '%{prefix}spec/tasks/%{rest}_rake_spec.rb'
# See https://gitlab.com/gitlab-org/gitlab/-/issues/368628
- source: '(?<prefix>ee/)?lib/gitlab/usage_data_counters/(?<rest>.+)\.rb'
test: 'spec/lib/gitlab/usage_data_spec.rb'
# See https://gitlab.com/gitlab-org/quality/engineering-productivity/master-broken-incidents/-/issues/54#note_1160811638
- source: '(?<prefix>ee/)?lib/gitlab/ci/config/(?<rest>.+)\.rb'
test: 'spec/lib/gitlab/ci/yaml_processor_spec.rb'
- source: 'ee/lib/gitlab/ci/config/(?<rest>.+)\.rb'
test: 'ee/spec/lib/gitlab/ci/yaml_processor_spec.rb'
# See https://gitlab.com/gitlab-org/gitlab/-/issues/466068#note_1987902951
- source: 'ee/lib/audit_events/strategies/(?<rest>.+)\.rb'
test: 'ee/spec/lib/audit_events/external_destination_streamer_spec.rb'
# FOSS tooling should map to respective spec
- source: 'tooling/(?<rest>.+)\.rb'
test: 'spec/tooling/%{rest}_spec.rb'
# RuboCop related specs
- source: 'rubocop/(?<rest>.+)\.rb'
test: 'spec/rubocop/%{rest}_spec.rb'
# .gitlab/ci related specs
- source: '.gitlab/ci/(?<rest>.+)\.gitlab-ci\.yml'
test: 'spec/dot_gitlab_ci/rules_spec.rb'
# Map config to respective specs
- source: 'config/(?<rest>.+)\..*'
test: 'spec/config/%{rest}_spec.rb'
# Initializers should map to respective spec
- source: 'config/initializers/(?<rest>.+)\.rb'
test: 'spec/initializers/%{rest}_spec.rb'
# DB structure should map to schema spec
- source: 'db/structure\.sql'
test: 'spec/db/schema_spec.rb'
# Migration should map to either timestamped or non-timestamped spec
- source: 'db/(?:post_)?migrate/(?:[0-9]+)_(?<name>.+)\.rb'
test: 'spec/migrations/%{name}_spec.rb'
- source: 'db/(?:post_)?migrate/(?<rest>[0-9]+_.+)\.rb'
test: 'spec/migrations/%{rest}_spec.rb'
# EE/FOSS views should map to respective spec
- source: '(?<prefix>ee/)?app/views/(?<rest>.+)\.haml'
test: '%{prefix}spec/views/%{rest}.haml_spec.rb'
# EE/FOSS controllers should map to request specs
- source: '(?<prefix>ee/)?app/controllers/(?<rest>.+)\.rb'
test: '%{prefix}spec/requests/%{rest}_spec.rb'
# EE/FOSS GraphQL resolvers map to request specs
- source: '(?<prefix>ee/)?app/graphql/resolvers/(?<rest>.+)_resolver\.rb'
test:
- '%{prefix}spec/requests/api/graphql/%{rest}_spec.rb'
- '%{prefix}spec/requests/api/graphql/%{rest}_query_spec.rb'
# EE/FOSS GraphQL mutations map to request specs
- source: '(?<prefix>ee/)?app/graphql/mutations/(?<rest>.+)\.rb'
test: '%{prefix}spec/requests/api/graphql/mutations/%{rest}_spec.rb'
# EE/FOSS spec code should map to itself
- source: '(?<rest>.+_spec\.rb)'
test: '%{rest}'
# EE extension spec should map to its FOSS class spec
- source: 'ee/spec/(?<directory>.*/)ee/(?<rest>.+\.rb)'
test: 'spec/%{directory}%{rest}'
# FOSS+EE factories map to FOSS/EE model specs
- source:
- '(?<prefix>ee/)?spec/factories/(?<model>.+)\.rb'
- '(?<prefix>ee/)?spec/factories/(?<model>.+)s\.rb'
test:
- 'spec/models/%{model}_spec.rb'
- 'ee/spec/models/ee/%{model}_spec.rb'
- '%{prefix}spec/models/%{model}_spec.rb'
- '%{prefix}spec/models/%{prefix}%{model}_spec.rb'
# Whats New should map to its respective spec
- source: 'data/whats_new/\w*\.yml'
test: 'spec/lib/release_highlights/validator_spec.rb'
# The documentation index page is used in this haml_lint spec
- source: 'doc/index\.md'
test: 'spec/haml_lint/linter/documentation_links_spec.rb'
- source: '(?<prefix>ee/)?app/models/.+\.rb'
test: 'spec/models/every_model_spec.rb'
- source: '(?<prefix>ee/)?app/workers/.+\.rb'
test: 'spec/workers/every_sidekiq_worker_spec.rb'
# Mailer previews
- source: '(?<prefix>ee/)?app/mailers/(?<inner_prefix>ee/)?previews/.+\.rb'
test: 'spec/mailers/previews_spec.rb'
## Remote development GraphQL resolvers
- source: 'ee/app/graphql/resolvers/remote_development/workspaces_for_agent_resolver\.rb'
test:
- 'ee/spec/requests/api/graphql/remote_development/cluster_agent/workspaces/*_spec.rb'
- source: 'ee/app/graphql/resolvers/remote_development/workspaces_for_current_user_resolver\.rb'
test:
- 'ee/spec/requests/api/graphql/remote_development/current_user/workspaces/*_spec.rb'
- source: 'ee/app/graphql/resolvers/remote_development/workspaces_for_query_root_resolver\.rb'
test:
- 'ee/spec/requests/api/graphql/remote_development/workspaces/*_spec.rb'
- source: 'ee/app/graphql/types/remote_development/workspace_type\.rb'
test:
- 'ee/spec/requests/api/graphql/remote_development/workspace/with_id_arg_spec.rb'
# Usage metric schema changes should trigger validations for all metrics and tooling
- source: 'config/metrics/schema/.*\.json'
test:
- 'spec/config/metrics/every_metric_definition_spec.rb'
- 'ee/spec/config/metrics/every_metric_definition_spec.rb'
- 'spec/lib/gitlab/usage/metric_definition_validate_all_spec.rb'
- 'spec/scripts/internal_events/cli_spec.rb'
- 'spec/support_specs/matchers/internal_events_matchers_spec.rb'
# Internal events schema changes should trigger validations for all events and tooling
- source: 'config/events/schema\.json'
test:
- 'spec/lib/gitlab/tracking/event_definition_validator_validate_all_spec.rb'
- 'spec/scripts/internal_events/cli_spec.rb'
- 'spec/support_specs/matchers/internal_events_matchers_spec.rb'
# Any change to metric/event definitions should trigger the specs in the ee/spec/config/metrics/ folder.
# See https://gitlab.com/gitlab-org/quality/engineering-productivity/master-broken-incidents/-/issues/287#note_1192008962
- source:
- '(ee/)?config/metrics/.*\.yml'
test:
- 'spec/config/metrics/every_metric_definition_spec.rb'
- 'ee/spec/config/metrics/every_metric_definition_spec.rb'
- 'spec/lib/gitlab/usage/metric_definition_validate_all_spec.rb'
# Internal event/Snowplow event definitions map to schema validation spec
- source:
- '(ee/)?config/events/.+\.yml'
test: 'spec/lib/gitlab/tracking/event_definition_validator_validate_all_spec.rb'
# Changes to Internal Events behavior should trigger tests for the CLI and shared matchers
- source:
- 'lib/gitlab/internal_events\.rb'
- 'scripts/internal_events/cli(/.+)?\.rb'
- 'spec/support/shared_examples/controllers/internal_event_tracking_examples\.rb'
- 'spec/support/matchers/internal_events_matchers\.rb'
- 'spec/fixtures/scripts/internal_events/.+\.yml'
test:
- 'spec/scripts/internal_events/cli_spec.rb'
- 'spec/support_specs/matchers/internal_events_matchers_spec.rb'
# See https://gitlab.com/gitlab-org/quality/engineering-productivity/team/-/issues/146
- source: 'config/feature_categories\.yml'
test:
- 'spec/db/docs_spec.rb'
- 'ee/spec/lib/ee/gitlab/database/docs/docs_spec.rb'
# Run database dictionary related specs on db/docs changes.
# https://gitlab.com/gitlab-org/quality/engineering-productivity/master-broken-incidents/-/issues/6276
- source: 'db/docs/.+\.yml'
test:
# Found via `git grep Database::Dictionary -l spec ee/spec`
- 'ee/spec/lib/gitlab/database/desired_sharding_key_spec.rb'
- 'spec/db/docs_spec.rb'
- 'spec/lib/gitlab/database/dictionary_spec.rb'
- 'ee/spec/lib/gitlab/database/inclusion_of_tables_with_gitlab_sec_schema_spec.rb'
- 'spec/lib/gitlab/database/no_new_tables_with_gitlab_main_schema_spec.rb'
- 'spec/lib/gitlab/database/sharding_key_spec.rb'
# See https://gitlab.com/gitlab-org/quality/engineering-productivity/master-broken-incidents/-/issues/1360
- source: 'vendor/project_templates/.*'
test: 'spec/lib/gitlab/project_template_spec.rb'
# See https://gitlab.com/gitlab-org/quality/engineering-productivity/master-broken-incidents/-/issues/1683#note_1385966977
- source: 'app/finders/members_finder\.rb'
test: 'spec/graphql/types/project_member_relation_enum_spec.rb'
- source: 'app/finders/group_members_finder\.rb'
test: 'spec/graphql/types/group_member_relation_enum_spec.rb'
# See https://gitlab.com/gitlab-org/quality/engineering-productivity/master-broken-incidents/-/issues/4440#note_1675547256
- source: 'lib/gitlab/ci/templates/.*\.gitlab-ci\.yml'
test:
- 'spec/lib/gitlab/ci/templates/templates_spec.rb'
- 'ee/spec/lib/ee/gitlab/ci/templates/templates_spec.rb'
# See https://gitlab.com/gitlab-org/quality/engineering-productivity/master-broken-incidents/-/issues/8021
- source: 'public/robots\.txt'
test:
- 'spec/requests/robots_txt_spec.rb'
# See https://gitlab.com/gitlab-org/gitlab/-/issues/466068#note_1987834618
- source: 'ee/app/replicators/geo/(?<rest>.+)\.rb'
test: 'ee/spec/models/geo_node_status_spec.rb'
# Any change to lib/sidebars/**/*.rb should map to specs that contain the words `sidebar` or `navbar`
#
# See https://gitlab.com/gitlab-org/gitlab/-/issues/466068#note_1988359861
- source: '(?<prefix>ee/)?lib/sidebars/(?<rest>.+)\.rb'
test: '%{prefix}spec/features/**/{navbar,sidebar}_spec.rb'
# See https://gitlab.com/gitlab-org/gitlab/-/issues/466068#note_2131393513
- source: 'ee/app/policies/ee/group_policy\.rb'
test: 'ee/spec/features/groups/groups_security_credentials_spec.rb'
# Any change to lib/gitlab/ci/mask_secret.rb should trigger any spec relying on masking CI secrets
# The list below was computed by searching for the following terms:
#
# - `[MASKED]` in any `spec` folder
# - `masked: true` in any `spec` folder
#
# See https://gitlab.com/gitlab-org/gitlab/-/issues/466068#note_2132805842
- source: 'lib/gitlab/ci/mask_secret\.rb'
test:
- ee/spec/lib/gitlab/ci/google_cloud/generate_build_environment_variables_service_spec.rb
- ee/spec/models/dast_site_profile_spec.rb
- ee/spec/models/ee/project_spec.rb
- spec/features/admin_variables_spec.rb
- spec/features/group_variables_spec.rb
- spec/features/project_group_variables_spec.rb
- spec/features/project_variables_spec.rb
- spec/lib/expand_variables_spec.rb
- spec/lib/gitlab/ci/build/rules/rule/clause/exists_spec.rb
- spec/lib/gitlab/ci/config/external/file/artifact_spec.rb
- spec/lib/gitlab/ci/config/external/file/base_spec.rb
- spec/lib/gitlab/ci/config/external/file/local_spec.rb
- spec/lib/gitlab/ci/config/external/file/project_spec.rb
- spec/lib/gitlab/ci/config/external/file/remote_spec.rb
- spec/lib/gitlab/ci/config/external/file/template_spec.rb
- spec/lib/gitlab/ci/config/external/mapper/matcher_spec.rb
- spec/lib/gitlab/ci/config/interpolation/functions/expand_vars_spec.rb
- spec/lib/gitlab/ci/mask_secret_spec.rb
- spec/lib/gitlab/ci/variables/collection/item_spec.rb
- spec/models/ci/build_spec.rb
- spec/models/clusters/kubernetes_namespace_spec.rb
- spec/models/clusters/platforms/kubernetes_spec.rb
- spec/models/integrations/apple_app_store_spec.rb
- spec/models/integrations/diffblue_cover_spec.rb
- spec/models/integrations/google_play_spec.rb
- spec/models/integrations/harbor_spec.rb
- spec/models/project_spec.rb
- spec/requests/api/admin/ci/variables_spec.rb
- spec/requests/api/ci/variables_spec.rb
- spec/requests/api/graphql/ci/group_variables_spec.rb
- spec/requests/api/graphql/ci/inherited_ci_variables_spec.rb
- spec/requests/api/graphql/ci/instance_variables_spec.rb
- spec/requests/api/graphql/ci/project_variables_spec.rb
- spec/requests/api/group_variables_spec.rb
- spec/services/ci/change_variable_service_spec.rb
- spec/services/ci/create_pipeline_service/creation_errors_and_warnings_spec.rb
# See https://gitlab.com/gitlab-org/gitlab/-/issues/466068#note_2132808426
- source: 'lib/gitlab/ci/build/rules/(?<rest>.+)\.rb'
test:
- spec/lib/gitlab/ci/build/rules/rule_spec.rb
- spec/lib/gitlab/ci/config/external/rules_spec.rb
# See https://gitlab.com/gitlab-org/gitlab/-/issues/466068#note_2138440847
- source: 'app/services/merge_requests/mergeability/(?<rest>.+)\.rb'
test: ee/spec/graphql/ee/types/merge_request_type_spec.rb
# Any change to the (ee/)lib/api/hooks folder, or any files in (ee/)lib/api/ with the `hook` substring in them
# should map to specs that contain the words `hook` in both {ee/,}spec/requests/api
#
# See https://gitlab.com/gitlab-org/gitlab/-/issues/466068#note_1939569462
- source:
- '(?<prefix>ee/)?lib/api/hooks/(?<rest>.+)\.rb'
- '(?<prefix>ee/)?lib/api/(?<rest>.+hook.+)\.rb'
test:
- '{ee/,}spec/requests/api/**/*hook*_spec.rb'
# Registration/Onboarding
- source:
- 'ee/app/(controllers|services)/registrations/.*'
- 'ee/app/controllers/concerns/ee/onboarding/status\.rb'
- 'app/controllers/concerns/onboarding/status\.rb'
test:
- 'ee/spec/features/registrations/saas/*_spec.rb'
- ee/spec/features/registrations/email_opt_in_registration_spec.rb
# ultimate trials
- source: 'ee/app/controllers/gitlab_subscriptions/trials_controller\.rb'
test:
- 'ee/spec/features/gitlab_subscriptions/trials/creation_*_spec.rb'
- ee/spec/features/gitlab_subscriptions/trials/access_denied_spec.rb
# duo pro trials
- source: 'ee/app/controllers/gitlab_subscriptions/trials/duo_pro_controller\.rb'
test: 'ee/spec/features/gitlab_subscriptions/trials/duo_pro/*_spec.rb'
# duo enterprise trials
- source: 'ee/app/controllers/gitlab_subscriptions/trials/duo_enterprise_controller\.rb'
test: 'ee/spec/features/gitlab_subscriptions/trials/duo_enterprise/*_spec.rb'
|