{"record":{"id":"e9b15affa572c83b","repo":"grosser/parallel_tests","slug":"group-by-found-and-single-process-are-not-supp","errorCode":null,"errorMessage":"--group-by found and --single-process are not supported","messagePattern":"--group-by found and --single-process are not supported","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"lib/parallel_tests/cli.rb","lineNumber":372,"sourceCode":"      files, remaining = extract_file_paths(argv)\n      unless options[:execute]\n        if files.empty?\n          default_test_folder = @runner.default_test_folder\n          if File.directory?(default_test_folder)\n            files = [default_test_folder]\n          else\n            abort \"Pass files or folders to run\"\n          end\n        end\n        options[:files] = files.map { |file_path| Pathname.new(file_path).cleanpath.to_s }\n      end\n\n      append_test_options(options, remaining)\n\n      options[:group_by] ||= :filesize if options[:only_group]\n\n      if options[:group_by] == :found && options[:single_process]\n        raise \"--group-by found and --single-process are not supported\"\n      end\n      allowed = [:filesize, :runtime, :found]\n      if !allowed.include?(options[:group_by]) && options[:only_group]\n        raise \"--group-by #{allowed.join(\" or \")} is required for --only-group\"\n      end\n\n      if options[:specify_groups] && options.keys.intersect?([:single_process, :isolate, :isolate_count])\n        raise \"Can't pass --specify-groups with any of these keys: --single, --isolate, or --isolate-n\"\n      end\n\n      if options[:failure_exit_code] && options[:highest_exit_status]\n        raise \"Can't pass --failure-exit-code and --highest-exit-status\"\n      end\n\n      options\n    end\n\n    def extract_file_paths(argv)","sourceCodeStart":354,"sourceCodeEnd":390,"githubUrl":"https://github.com/grosser/parallel_tests/blob/a06047856d3564ee77848e230d61cb6503037ad7/lib/parallel_tests/cli.rb#L354-L390","documentation":"--group-by found distributes test files across processes in the order they are discovered on disk, which carries no size or weight information. -s/--single PATTERN depends on size-aware bin-packing to keep all matching files in one process, so parse_options! rejects the combination up front with a RuntimeError.","triggerScenarios":"Any invocation pairing the two: `parallel_test --group-by found -s spec/features` or `--group-by found --single heavy_`; equally through rake, e.g. `rake parallel:spec PARALLEL_TEST_OPTS='--group-by found --single features'`.","commonSituations":"Switching the grouping strategy to 'found' for deterministic, reproducible distribution while keeping an existing --single flag for feature folders; copying a full flag set from another team's CI config without pruning incompatible parts.","solutions":["Drop -s/--single from the command -- 'found' grouping cannot honor it","Switch --group-by to filesize (the default) or runtime so --single works","If deterministic selection was the goal, keep --group-by found and use --only-group to pick group indexes instead of --single"],"exampleFix":"# before\nparallel_test --group-by found --single spec/features\n\n# after\nparallel_test --group-by filesize --single spec/features","handlingStrategy":"validation","validationCode":"opts = ENV.fetch('PARALLEL_TEST_OPTS', '').shellsplit\nfound = opts.include?('--group-by') && opts[opts.index('--group-by') + 1] == 'found'\nhas_single = opts.any? { |o| o == '-s' || o.start_with?('--single') }\nif found && has_single\n  abort 'parallel_tests: --group-by found cannot be combined with --single'\nend","typeGuard":"def group_by_found_compatible?(argv)\n  return true unless argv.each_slice(2).any? { |flag, v| flag == '--group-by' && v == 'found' }\n  argv.none? { |a| a == '-s' || a.start_with?('--single') }\nend","tryCatchPattern":"begin\n  ParallelTests::CLI.new.run(args)\nrescue RuntimeError => e\n  abort \"#{e.message} -- pick one grouping strategy or one placement flag\"\nend","preventionTips":["Decide the grouping strategy centrally (one ENV var / rake constant) instead of mixing per-job flags","When switching --group-by, re-audit every other flag that depends on size-aware grouping (--single, --isolate)","Wrap the CLI in a rake task that whitelists known-good flag combinations"],"tags":["ruby","parallel-tests","cli","grouping","conflicting-options"],"backgroundTag":"conflicting-cli-options","analyzedSha":"a06047856d3564ee77848e230d61cb6503037ad7","analyzedAt":"2026-08-23T10:12:36.391Z","schemaVersion":2},"datasetVersion":"2026-08-23T13:39:53.451Z"}