Welcome to mirror list, hosted at ThFree Co, Russian Federation.

coverage_report.rb « reports « entry « config « ci « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 98119c7fd53b70697381f3a7c6951a2111e91ac8 (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
# frozen_string_literal: true

module Gitlab
  module Ci
    class Config
      module Entry
        class Reports
          class CoverageReport < ::Gitlab::Config::Entry::Node
            include ::Gitlab::Config::Entry::Validatable
            include ::Gitlab::Config::Entry::Attributable

            ALLOWED_KEYS = %i[coverage_format path].freeze
            SUPPORTED_COVERAGE = %w[cobertura].freeze

            attributes ALLOWED_KEYS

            validations do
              validates :config, type: Hash
              validates :config, allowed_keys: ALLOWED_KEYS

              with_options(presence: true) do
                validates :coverage_format, inclusion: { in: SUPPORTED_COVERAGE, message: "must be one of supported formats: #{SUPPORTED_COVERAGE.join(', ')}." }
                validates :path, type: String
              end
            end
          end
        end
      end
    end
  end
end