diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 22:00:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 22:00:14 +0300 |
commit | 05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2 (patch) | |
tree | 11d0f2a6ec31c7793c184106cedc2ded3d9a2cc5 /spec/services/ml/experiment_tracking/candidate_repository_spec.rb | |
parent | ec73467c23693d0db63a797d10194da9e72a74af (diff) |
Add latest changes from gitlab-org/gitlab@15-8-stable-eev15.8.0-rc42
Diffstat (limited to 'spec/services/ml/experiment_tracking/candidate_repository_spec.rb')
-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 |