summaryrefslogtreecommitdiff
path: root/tests.yml
blob: 76ebb05eddb899041ab7ddaa38ceccddf8a5dab3 (plain)
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
mapping:
  # EE code should map to respective spec
  - source: ee/app/(.+)\.rb
    test: ee/spec/%s_spec.rb
  # FOSS code should map to respective spec
  - source: app/(.+)\.rb
    test: spec/%s_spec.rb

  # EE extension should also map to its FOSS class spec
  - source: ee/app/(.*/)ee/(.+)\.rb
    test: spec/%s%s_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
  - source: ee/app/(.*/)ee/(.+)\.rb
    test: ee/spec/%s%s_spec.rb

  # EE lib should map to respective spec
  - source: ee/lib/(.+)\.rb
    test: ee/spec/lib/%s_spec.rb

  # See https://gitlab.com/gitlab-org/gitlab/-/issues/368628
  - source: lib/gitlab/usage_data_counters/(.+)\.rb
    test: spec/lib/gitlab/usage_data_spec.rb

  # FOSS lib & tooling should map to respective spec
  - source: (tooling/)?lib/(.+)\.rb
    test: spec/%slib/%s_spec.rb

  # Initializers should map to respective spec
  - source: config/initializers/(.+)\.rb
    test: spec/initializers/%s_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]+)_(.+)\.rb
    test: spec/migrations/%s_spec.rb
  - source: db/(?:post_)?migrate/([0-9]+)_(.+)\.rb
    test: spec/migrations/%s_%s_spec.rb

  # EE/FOSS views should map to respective spec
  - source: (ee/)?app/views/(.+)\.haml
    test: '%sspec/views/%s.haml_spec.rb'

  # EE/FOSS spec code should map to itself
  - source: (ee/)?spec/(.+)_spec\.rb
    test: '%sspec/%s_spec.rb'

  # EE extension spec should map to its FOSS class spec
  - source: ee/spec/(.*/)ee/(.+)\.rb
    test: spec/%s%s.rb

  # EE/FOSS factory should map to factories spec
  - source: (ee/)?spec/factories/.+\.rb
    test: spec/models/factories_spec.rb

  # Whats New should map to its respective spec
  - source: data/whats_new/\w*.yml
    test: spec/lib/release_highlights/validator_spec.rb

  - source: (ee/)?app/workers/.+\.rb
    test: spec/workers/every_sidekiq_worker_spec.rb

  - source: lib/gitlab/usage_data_counters/known_events/.+\.yml
    test: spec/lib/gitlab/usage_data_counters/hll_redis_counter_spec.rb
  - source: lib/gitlab/usage_data_counters/known_events/.+\.yml
    test: spec/lib/gitlab/usage_data_spec.rb

  # Mailer previews
  - source: (ee/)?app/mailers/previews/.+\.rb
    test: spec/mailers/previews_spec.rb
  - source: ee/app/mailers/ee/preview/.+\.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
  - source: glfm_specification/.+
    test: ee/spec/requests/api/markdown_snapshot_spec.rb