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

reports.rb « security « reports « ci « factories « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5699b8fee3e26ca7951a0e32a8d43dc3a957df01 (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
# frozen_string_literal: true

FactoryBot.define do
  factory :ci_reports_security_report, class: '::Gitlab::Ci::Reports::Security::Report' do
    type { :sast }
    pipeline { association(:ci_pipeline) }
    created_at { 2.weeks.ago }
    scanned_resources { [] }

    transient do
      findings { [] }
      scanners { [] }
      identifiers { [] }
    end

    after :build do |report, evaluator|
      evaluator.scanners.each { |s| report.add_scanner(s) }
      evaluator.identifiers.each { |id| report.add_identifier(id) }
      evaluator.findings.each { |o| report.add_finding(o) }
    end

    skip_create

    initialize_with do
      ::Gitlab::Ci::Reports::Security::Report.new(type, pipeline, created_at)
    end
  end
end