Class: Ace::Test::EndToEndRunner::CLI::Commands::RunTest
- Inherits:
-
Support::Cli::Command
- Object
- Support::Cli::Command
- Ace::Test::EndToEndRunner::CLI::Commands::RunTest
- Includes:
- Support::Cli::Base
- Defined in:
- lib/ace/test/end_to_end_runner/cli/commands/run_test.rb
Overview
CLI command for running E2E tests
Supports running a single test by ID or all tests in a package. Tests are executed via LLM and results are written to standard report locations.
Instance Method Summary collapse
Instance Method Details
#call(package:, test_id: nil, **options) ⇒ Object
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/ace/test/end_to_end_runner/cli/commands/run_test.rb', line 70 def call(package:, test_id: nil, **) = coerce_types(, timeout: :integer, parallel: :integer) output = quiet?() ? StringIO.new : $stdout prune_artifacts = !![:prune_artifacts] if [:dry_run] && prune_artifacts raise Ace::Support::Cli::Error.new( "--prune-artifacts cannot be used with --dry-run" ) end prune_artifacts_if_requested(output: output, prune_artifacts: prune_artifacts, quiet: quiet?()) # Handle dry-run mode if [:dry_run] return handle_dry_run(package, test_id, output, tags: ([:tags])) end orchestrator = build_orchestrator( provider: [:provider], timeout: [:timeout], parallel: [:parallel], progress: [:progress] ) results = orchestrator.run( package: package, test_id: test_id, verify: [:verify], tags: ([:tags]), cli_args: [:cli_args], run_id: [:run_id], report_dir: [:report_dir], output: output ) if results.empty? raise Ace::Support::Cli::Error.new( "No tests found for package '#{package}'" + (test_id ? " with ID '#{test_id}'" : "") ) end # Exit with error if any test failed (excluding skips) if results.any?(&:failed?) failed = results.select(&:failed?) failed_ids = failed.map(&:test_id).join(", ") raise Ace::Support::Cli::Error.new( "#{failed.size} test(s) failed: #{failed_ids}" ) end end |