Class: Ace::Test::EndToEndRunner::CLI::Commands::RunSuite
- Inherits:
-
Support::Cli::Command
- Object
- Support::Cli::Command
- Ace::Test::EndToEndRunner::CLI::Commands::RunSuite
- Includes:
- Support::Cli::Base
- Defined in:
- lib/ace/test/end_to_end_runner/cli/commands/run_suite.rb
Overview
CLI command for running E2E test suite across all packages
Discovers all E2E tests in the monorepo and executes them with optional parallel execution and affected package filtering.
Instance Method Summary collapse
Instance Method Details
#call(packages: nil, **options) ⇒ Object
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 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 |
# File 'lib/ace/test/end_to_end_runner/cli/commands/run_suite.rb', line 76 def call(packages: nil, **) = coerce_types(, parallel: :integer, timeout: :integer) parallel = [:parallel] affected = !![:affected] only_failures = !![:only_failures] prune_artifacts = !![:prune_artifacts] = parse_csv_list([:tags]) = parse_csv_list([:exclude_tags]) if only_failures && prune_artifacts raise Ace::Support::Cli::Error.new( "--prune-artifacts cannot be used with --only-failures" ) end retry_failures_once = resolve_retry_failures_once( requested: [:retry_failures_once], packages: packages, affected: affected, only_failures: only_failures, tags: , exclude_tags: ) output = quiet?() ? StringIO.new : $stdout progress = [:progress] && !quiet?() prune_artifacts_if_requested(output: output, prune_artifacts: prune_artifacts, quiet: quiet?()) orchestrator = build_orchestrator( max_parallel: [parallel, 1].max, output: output, progress: progress ) = { parallel: parallel > 0, affected: affected, only_failures: only_failures, packages: packages, cli_args: [:cli_args], provider: [:provider], timeout: [:timeout], tags: , exclude_tags: , verify: [:verify] } results = run_suite_with_retry( orchestrator, run_options: , output: output, retry_failures_once: retry_failures_once ) if results[:total].zero? if only_failures raise Ace::Support::Cli::Error.new( "No failed test scenarios found in cache" ) else raise Ace::Support::Cli::Error.new("No tests found to run") end end # Exit with error if any test failed if results[:failed] > 0 || results[:errors] > 0 failed_count = results[:failed] + results[:errors] raise Ace::Support::Cli::Error.new( results[:retry_attempted] ? "#{failed_count} test(s) failed or errored after retry" : "#{failed_count} test(s) failed or errored" ) end results end |