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

candidates.rb « ml « factories « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 27b31524b1f5c6e37c6fb5f690303611500f6b2a (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
# frozen_string_literal: true
FactoryBot.define do
  factory :ml_candidates, class: '::Ml::Candidate' do
    project { association :project }
    user { project.owner }
    experiment { association :ml_experiments, project_id: project.id, user: project.owner }

    trait :with_metrics_and_params do
      metrics { Array.new(2) { association(:ml_candidate_metrics, candidate: instance) } }
      params { Array.new(2) { association(:ml_candidate_params, candidate: instance) } }
    end

    trait :with_metadata do
      metadata { Array.new(2) { association(:ml_candidate_metadata, candidate: instance) } }
    end

    trait :with_artifact do
      artifact do
        association(:generic_package, name: instance.package_name, version: instance.package_version || '1',
          project: project)
      end
    end
  end
end