diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 12:10:40 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 12:10:40 +0300 |
commit | 0a921554d8c33ccbbd1f2edcee8cd70a0ecfd1a2 (patch) | |
tree | dfe8044b0be8bce7ecc962d9bc30225b6d2e0383 /spec/services | |
parent | 4e5ac6eec9269941c0847200f8a915c2dbe56872 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/ml/experiment_tracking/candidate_repository_spec.rb | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/spec/services/ml/experiment_tracking/candidate_repository_spec.rb b/spec/services/ml/experiment_tracking/candidate_repository_spec.rb index ff3b295d185..e3c05178025 100644 --- a/spec/services/ml/experiment_tracking/candidate_repository_spec.rb +++ b/spec/services/ml/experiment_tracking/candidate_repository_spec.rb @@ -31,17 +31,37 @@ RSpec.describe ::Ml::ExperimentTracking::CandidateRepository do end describe '#create!' do - subject { repository.create!(experiment, 1234, [{ key: 'hello', value: 'world' }]) } + let(:tags) { [{ key: 'hello', value: 'world' }] } + let(:name) { 'some_candidate' } + + subject { repository.create!(experiment, 1234, tags, name) } it 'creates the candidate' do expect(subject.start_time).to eq(1234) expect(subject.iid).not_to be_nil expect(subject.end_time).to be_nil + expect(subject.name).to eq('some_candidate') end it 'creates with tag' do expect(subject.metadata.length).to eq(1) end + + context 'when name is passed as tag' do + let(:tags) { [{ key: 'mlflow.runName', value: 'blah' }] } + + it 'ignores if name is not nil' do + expect(subject.name).to eq('some_candidate') + end + + context 'when name is nil' do + let(:name) { nil } + + it 'sets the mlflow.runName as candidate name' do + expect(subject.name).to eq('blah') + end + end + end end describe '#update' do |