Skip to content

Commit

Permalink
add test for federated search
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilelkihal committed Oct 9, 2024
1 parent 8634818 commit 1a4e61e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/models/test_federation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,21 @@ def test_federation_ssl_error
refute_nil ontologies_federate_one.first.errors
WebMock.disable!
end

def test_federated_search
query = 'test'

time1 = Benchmark.realtime do
@search_results = LinkedData::Client::Models::Class.search(query)[:collection]
end

time2 = Benchmark.realtime do
@federated_search_results = LinkedData::Client::Models::Class.search(query, {federate: 'true'})[:collection]
end

puts "Search results: #{@search_results .length} in #{time1}s"
puts "Federated search results: #{@federated_search_results.length} in #{time2}s"

refute_equal @search_results.length, @federated_search_results.length
end
end

0 comments on commit 1a4e61e

Please sign in to comment.