diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-26 03:08:57 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-07-26 03:08:57 +0300 |
commit | b8fcf7c3d6c3b48e59e6aae5b1a6b536bba8ac40 (patch) | |
tree | 947b357adb3c1b51f2fb7ec761a7d9a35c260e28 /spec/factories | |
parent | 5edc7a04de12237658e7149385661aede45d681c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/factories')
-rw-r--r-- | spec/factories/ml/model_versions.rb | 2 | ||||
-rw-r--r-- | spec/factories/ml/models.rb | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/spec/factories/ml/model_versions.rb b/spec/factories/ml/model_versions.rb index 5ae0446b78d..61d42fa5b5c 100644 --- a/spec/factories/ml/model_versions.rb +++ b/spec/factories/ml/model_versions.rb @@ -9,7 +9,7 @@ FactoryBot.define do trait :with_package do package do - association :ml_model_package, name: model.name, version: version, project_id: project.id + association :ml_model_package, name: model.name, version: version, project: project end end end diff --git a/spec/factories/ml/models.rb b/spec/factories/ml/models.rb index 2d1b29289a5..158c26499b0 100644 --- a/spec/factories/ml/models.rb +++ b/spec/factories/ml/models.rb @@ -6,5 +6,17 @@ FactoryBot.define do project default_experiment { association :ml_experiments, project_id: project.id, name: name } + + trait :with_versions do + versions { Array.new(2) { association(:ml_model_versions, model: instance) } } + end + + trait :with_latest_version_and_package do + transient do + version { association(:ml_model_versions, :with_package, model: instance) } + end + versions { [version] } + latest_version { version } + end end end |