mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-08-16 15:57:22 +00:00
185 lines
7.6 KiB
YAML
185 lines
7.6 KiB
YAML
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'
|
|
|
|
# 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/%{rest}_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'
|
|
|
|
# Snowplow definitions map to schema validation spec
|
|
- source:
|
|
- '(?<prefix>ee/)?config/events/.+\.yml'
|
|
- 'config/events/schema\.json'
|
|
test: 'spec/lib/gitlab/tracking/event_definition_validate_all_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'
|
|
|
|
## GLFM spec and config files for CE and EE should map to respective markdown snapshot specs
|
|
- source: 'glfm_specification/.+'
|
|
test:
|
|
- 'spec/requests/api/markdown_snapshot_spec.rb'
|
|
- 'ee/spec/requests/api/markdown_snapshot_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'
|
|
|
|
# Any change to metrics definition should trigger the specs in the ee/spec/config/metrics/ folder.
|
|
#
|
|
# Note: We only have those tests for ee, even though we have non-ee metrics.
|
|
#
|
|
# See https://gitlab.com/gitlab-org/quality/engineering-productivity/master-broken-incidents/-/issues/287#note_1192008962
|
|
- source: 'ee/config/metrics/.*\.yml'
|
|
test: 'ee/spec/config/metrics/every_metric_definition_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'
|
|
- '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'
|