From a6a5d172a612ca8ce71287805c87b415b8fc8b4c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2024 15:19:36 -0400 Subject: [PATCH] Revert "Attempting to make requests to the mflux ci server instead of our local docker container" This reverts commit 287c5b9b842843d053b3ca642ec9f667059663b1. --- app/models/mediaflux/request.rb | 7 +------ config/mediaflux.yml | 2 +- spec/models/mediaflux/asset_exist_request_headers_spec.rb | 2 +- spec/system/welcome_spec.rb | 2 +- spec/views/mediaflux_infos/index.html.erb_spec.rb | 2 +- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/app/models/mediaflux/request.rb b/app/models/mediaflux/request.rb index 61d69a78..93f8d78a 100644 --- a/app/models/mediaflux/request.rb +++ b/app/models/mediaflux/request.rb @@ -14,11 +14,7 @@ def self.request_path end def self.uri - if Connection.host == "0.0.0.0" - URI("#{Connection.transport}://#{Connection.host}:#{Connection.port}/#{request_path}") - else - URI("#{Connection.transport}://#{Connection.host}/#{request_path}") - end + URI("#{Connection.transport}://#{Connection.host}:#{Connection.port}/#{request_path}") end # Constructs a new HTTP POST request for usage with the Mediaflux API @@ -60,7 +56,6 @@ def initialize(file: nil, session_token: nil, http_client: nil, session_user: ni # Resolves the HTTP request against the Mediaflux API # @return [Net::HTTP] def resolve - puts(Rails.configuration.mediaflux["api_host"]) @http_response = @http_client.request self.class.uri, http_request end diff --git a/config/mediaflux.yml b/config/mediaflux.yml index 2723b1e2..62ceea16 100644 --- a/config/mediaflux.yml +++ b/config/mediaflux.yml @@ -95,7 +95,7 @@ test: api_root_collection_namespace: '/td-test-001/test' api_root_collection: 'path=/td-test-001/test/tigerdata' api_transport: 'http' - api_host: 'mflux-ci.lib.princeton.edu' + api_host: <%= ENV["TEST_MEDIAFLUX_HOST"] || '0.0.0.0' %> api_port: <%= ENV["TEST_MEDIAFLUX_PORT"] || '8888' %> # Alternate to test is still a test location diff --git a/spec/models/mediaflux/asset_exist_request_headers_spec.rb b/spec/models/mediaflux/asset_exist_request_headers_spec.rb index 0d3dd8f0..2e86782c 100644 --- a/spec/models/mediaflux/asset_exist_request_headers_spec.rb +++ b/spec/models/mediaflux/asset_exist_request_headers_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "rails_helper" -RSpec.describe Mediaflux::AssetExistRequest, type: :model, connect_to_mediaflux: true do +RSpec.describe Mediaflux::AssetExistRequest, type: :model, connect_to_mediaflux: false do let(:user) { FactoryBot.create(:user) } let(:namespace_root) { Rails.configuration.mediaflux["api_root_collection_namespace"] } diff --git a/spec/system/welcome_spec.rb b/spec/system/welcome_spec.rb index 2eab1715..01c211bd 100644 --- a/spec/system/welcome_spec.rb +++ b/spec/system/welcome_spec.rb @@ -60,7 +60,7 @@ expect(page).to have_content "Log Out" end - it "shows the Mediflux version on the home page for a logged in user" do + it "shows the Mediflux version on the home page for a logged in user", connect_to_mediaflux: true do sign_in current_user visit "/" sleep(1) diff --git a/spec/views/mediaflux_infos/index.html.erb_spec.rb b/spec/views/mediaflux_infos/index.html.erb_spec.rb index 59405f7f..43435bbb 100644 --- a/spec/views/mediaflux_infos/index.html.erb_spec.rb +++ b/spec/views/mediaflux_infos/index.html.erb_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "rails_helper" -RSpec.describe "mediaflux_info/index", type: :view, connect_to_mediaflux: true do +RSpec.describe "mediaflux_info/index", type: :view do before(:each) do assign(:mf_version, { version: "1001" }) end