class UC3::TestClient
Identify routes for Consistency Checks and for Unit Testing
Attributes
Public Class Methods
Source
# File app/lib/client/uc3_client.rb, line 352 def self.client UC3::UC3Client.clients.fetch(self.class.to_s, TestClient.new) end
Source
# File app/lib/client/uc3_client.rb, line 289 def initialize super(enabled: true) @test_paths = [] @consistency_checks = [] UC3Query::QueryClient.client.queries.each_key do |name| name = name.to_s %w[ /queries/consistency/.*/ /ops/collections/db/ /ops/db-queue/audit/counts-by-state /ops/db-queue/audit/oldest-audit-check /ops/db-queue/audit/30-days /ops/db-queue/audit/active-batches /ops/db-queue/audit/new-ucb-content /ops/db-queue-update/audit/reset-new-ucb-content /ops/db-queue/replication/failed /ops/db-queue/replication/in-progress /ops/db-queue/replication/required /ops/storage/db/nodes ].each do |pattern| next if name =~ %r{/objlist} @consistency_checks << name if name =~ /#{pattern}/ end next if name =~ %r{/objlist} @test_paths << name unless @consistency_checks.include?(name) end Sinatra::Application.routes['GET'].each do |path, route| # .each_keys does not work, so make use of route object puts "Route #{path}: #{route.inspect}" unless route.empty? path = path.to_s next if path.include? '**' next if path.include? '*/*' if path.include? '*' if path.start_with?('/source/') UC3Code::SourceCodeClient.client.reponames.each do |repo| @test_paths << path.gsub('*', repo.to_s) end end else @test_paths << path # TODO: SSM documentation %w[ /ldap/collections-missing /ops/zk/access/jobs /ops/zk/ingest/jobs-by-collection /ops/zk/ingest/batches /ops/zk/nodes/orphan /ops/ingest-folders/list ].each do |pattern| @consistency_checks << path if path =~ /#{pattern}/ end end end @test_paths.sort! @consistency_checks.sort! end
              Calls superclass method
              
        UC3::UC3Client::new