Class: Ace::TestRunner::CLI::Commands::Test
- Inherits:
-
Support::Cli::Command
- Object
- Support::Cli::Command
- Ace::TestRunner::CLI::Commands::Test
- Includes:
- Support::Cli::Base
- Defined in:
- lib/ace/test_runner/cli/commands/test.rb
Overview
ace-support-cli Command class for the test command
This command runs tests with flexible package, target, and file selection. All business logic is inline in this single command class.
Instance Method Summary collapse
Instance Method Details
#call(args: [], **options) ⇒ Object
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
# File 'lib/ace/test_runner/cli/commands/test.rb', line 114 def call(args: [], **) if [:version] puts "ace-test #{Ace::TestRunner::VERSION}" return 0 end # Type-convert numeric options (ace-support-cli returns strings, Thor converted to integers) # This maintains parity with the Thor implementation = %i[timeout max_display profile cleanup_keep cleanup_age] .each do |key| [key] = [key].to_i if [key] end if [:target] && args.none? { |arg| !arg.start_with?("-") && !File.exist?(arg) } args = [[:target]] + args end # Build test options with defaults = () # Display config summary display_config_summary() # Handle special modes first result = handle_special_modes(args, ) return result if result # Parse CLI arguments using CliArgumentParser begin arg_parser = Molecules::CliArgumentParser.new(args) parsed_args = arg_parser.parse .merge!(parsed_args) rescue ArgumentError => e raise Ace::Support::Cli::Error.new(e.) end # Run tests with special exit! handling for Minitest compatibility run_tests_with_exit_handling() rescue Ace::TestRunner::Error => e raise Ace::Support::Cli::Error.new(e.) rescue Interrupt raise Ace::Support::Cli::Error.new("Test execution interrupted", exit_code: 130) rescue => e raise Ace::Support::Cli::Error.new("Unexpected error: #{e.}") end |