diff options
Diffstat (limited to 'spec/requests/api/ml/mlflow/runs_spec.rb')
-rw-r--r-- | spec/requests/api/ml/mlflow/runs_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/requests/api/ml/mlflow/runs_spec.rb b/spec/requests/api/ml/mlflow/runs_spec.rb index a85fe4d867a..45479666e9a 100644 --- a/spec/requests/api/ml/mlflow/runs_spec.rb +++ b/spec/requests/api/ml/mlflow/runs_spec.rb @@ -39,6 +39,11 @@ RSpec.describe API::Ml::Mlflow::Runs, feature_category: :mlops do response end + before do + allow(Gitlab::Application.routes).to receive(:default_url_options) + .and_return(protocol: 'http', host: 'www.example.com', script_name: '') + end + RSpec.shared_examples 'MLflow|run_id param error cases' do context 'when run id is not passed' do let(:params) { {} } @@ -162,6 +167,17 @@ RSpec.describe API::Ml::Mlflow::Runs, feature_category: :mlops do }) end + context 'with a relative root URL' do + before do + allow(Gitlab::Application.routes).to receive(:default_url_options) + .and_return(protocol: 'http', host: 'www.example.com', script_name: '/gitlab/root') + end + + it 'gets a run including a valid artifact_uri' do + expect(json_response['run']['info']['artifact_uri']).to eql("http://www.example.com/gitlab/root/api/v4/projects/#{project_id}/packages/generic/ml_experiment_#{experiment.iid}/#{candidate.iid}/") + end + end + describe 'Error States' do it_behaves_like 'MLflow|run_id param error cases' it_behaves_like 'MLflow|shared error cases' |