From 0d17cd039b45dcb971db8f2cbc3fdbe1016bdb32 Mon Sep 17 00:00:00 2001 From: Shaumik-Ashraf Date: Mon, 23 Dec 2024 09:22:40 -0500 Subject: [PATCH] FI-3395 Fix suite describe with routes (#577) * draft client dev suite * use SuiteEndpoint * fix describe suite command and comment * rm dev_client_suites * create lib/inferno/route_storage.rb * clean --- lib/inferno.rb | 4 +--- lib/inferno/apps/cli/suites.rb | 2 -- lib/inferno/config/boot/suites.rb | 1 + lib/inferno/route_storage.rb | 10 ++++++++++ 4 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 lib/inferno/route_storage.rb diff --git a/lib/inferno.rb b/lib/inferno.rb index 8e79d096b..2c74f1f5b 100644 --- a/lib/inferno.rb +++ b/lib/inferno.rb @@ -1,7 +1,4 @@ module Inferno - def self.routes - @routes ||= [] - end end require_relative 'inferno/config/application' @@ -14,3 +11,4 @@ def self.routes require_relative 'inferno/test_runner' require_relative 'inferno/version' require_relative 'inferno/utils/static_assets' +require_relative 'inferno/route_storage' diff --git a/lib/inferno/apps/cli/suites.rb b/lib/inferno/apps/cli/suites.rb index 2ae36f8dc..03946dc34 100644 --- a/lib/inferno/apps/cli/suites.rb +++ b/lib/inferno/apps/cli/suites.rb @@ -6,8 +6,6 @@ class Suites def run ENV['NO_DB'] = 'true' - require_relative '../../../inferno' - Inferno::Application.start(:suites) suites = Inferno::Repositories::TestSuites.new.all diff --git a/lib/inferno/config/boot/suites.rb b/lib/inferno/config/boot/suites.rb index 58eaa257d..9445c946f 100644 --- a/lib/inferno/config/boot/suites.rb +++ b/lib/inferno/config/boot/suites.rb @@ -6,6 +6,7 @@ require 'inferno/entities/test_group' require 'inferno/entities/test_suite' require 'inferno/entities/test_kit' + require 'inferno/route_storage' files_to_load = Dir.glob(File.join(Dir.pwd, 'lib', '*.rb')) diff --git a/lib/inferno/route_storage.rb b/lib/inferno/route_storage.rb new file mode 100644 index 000000000..d9c780bd6 --- /dev/null +++ b/lib/inferno/route_storage.rb @@ -0,0 +1,10 @@ +module Inferno + # @private + module RouteStorage + def routes + @routes ||= [] + end + end + + extend RouteStorage +end