Skip to content

Commit

Permalink
Attempting to make requests to the mflux ci server instead of our loc…
Browse files Browse the repository at this point in the history
…al docker container
  • Loading branch information
JaymeeH committed Aug 9, 2024
1 parent 1cd9712 commit 287c5b9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion app/models/mediaflux/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ def self.request_path
end

def self.uri
URI("#{Connection.transport}://#{Connection.host}:#{Connection.port}/#{request_path}")
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
end

# Constructs a new HTTP POST request for usage with the Mediaflux API
Expand Down Expand Up @@ -56,6 +60,7 @@ 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

Expand Down
2 changes: 1 addition & 1 deletion config/mediaflux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: <%= ENV["TEST_MEDIAFLUX_HOST"] || '0.0.0.0' %>
api_host: 'mflux-ci.lib.princeton.edu'
api_port: <%= ENV["TEST_MEDIAFLUX_PORT"] || '8888' %>

# Alternate to test is still a test location
Expand Down
2 changes: 1 addition & 1 deletion spec/models/mediaflux/asset_exist_request_headers_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true
require "rails_helper"

RSpec.describe Mediaflux::AssetExistRequest, type: :model, connect_to_mediaflux: false do
RSpec.describe Mediaflux::AssetExistRequest, type: :model, connect_to_mediaflux: true do
let(:user) { FactoryBot.create(:user) }
let(:namespace_root) { Rails.configuration.mediaflux["api_root_collection_namespace"] }

Expand Down
2 changes: 1 addition & 1 deletion spec/system/welcome_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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", connect_to_mediaflux: true do
it "shows the Mediflux version on the home page for a logged in user" do
sign_in current_user
visit "/"
sleep(1)
Expand Down
2 changes: 1 addition & 1 deletion spec/views/mediaflux_infos/index.html.erb_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true
require "rails_helper"

RSpec.describe "mediaflux_info/index", type: :view do
RSpec.describe "mediaflux_info/index", type: :view, connect_to_mediaflux: true do
before(:each) do
assign(:mf_version, { version: "1001" })
end
Expand Down

0 comments on commit 287c5b9

Please sign in to comment.