{"record":{"id":"0c50b22905dda64d","repo":"grosser/parallel_tests","slug":"could-not-find-specified-specs-not-found-from","errorCode":null,"errorMessage":"Could not find #{specified_specs_not_found} from --specify-groups in the selected files & folders","messagePattern":"Could not find #(.+?) from --specify-groups in the selected files & folders","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"lib/parallel_tests/grouper.rb","lineNumber":69,"sourceCode":"      def specified_groups(options)\n        groups = options[:specify_groups]\n        return groups if groups != '-'\n\n        $stdin.read.chomp\n      end\n\n      def specify_groups(items, num_groups, options, groups)\n        specify_test_process_groups = specified_groups(options).split('|')\n        if specify_test_process_groups.count > num_groups\n          raise 'Number of processes separated by pipe must be less than or equal to the total number of processes'\n        end\n\n        all_specified_tests = specify_test_process_groups.map { |group| group.split(',') }.flatten\n        specified_items_found, items = items.partition { |item, _size| all_specified_tests.include?(item) }\n\n        specified_specs_not_found = all_specified_tests - specified_items_found.map(&:first)\n        if specified_specs_not_found.any?\n          raise \"Could not find #{specified_specs_not_found} from --specify-groups in the selected files & folders\"\n        end\n\n        if specify_test_process_groups.count == num_groups && items.flatten.any?\n          raise(\n            <<~ERROR\n              The number of groups in --specify-groups matches the number of groups from -n but there were other specs\n              found in the selected files & folders not specified in --specify-groups. Make sure -n is larger than the\n              number of processes in --specify-groups if there are other specs that need to be run. The specs that aren't run:\n              #{items.map(&:first)}\n            ERROR\n          )\n        end\n\n        # First order the specify_groups into the main groups array\n        specify_test_process_groups.each_with_index do |specify_test_process, i|\n          groups[i] = specify_test_process.split(',')\n        end\n","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/grosser/parallel_tests/blob/a06047856d3564ee77848e230d61cb6503037ad7/lib/parallel_tests/grouper.rb#L51-L87","documentation":"Every comma-separated entry in --specify-groups is matched by exact string equality against the test file paths parallel_tests discovered under the selected folders. Any entry that matches nothing -- typo, bare filename instead of the discovered path, absolute vs relative mismatch, or a file filtered out by --pattern/--exclude-pattern/--suffix -- is reported by this raise from Grouper.specify_groups.","triggerScenarios":"`parallel_test --specify-groups 'user_spec.rb|auth_spec.rb'` when the discovered paths are spec/models/user_spec.rb etc.; renaming or moving a spec after hardcoding the group list; running from a different working directory; the listed file being excluded by -p/--exclude-pattern or not matching the test-file suffix.","commonSituations":"Pinned-group lists in CI rot as files move; paths copied from an editor (absolute) while discovery produced relative paths; a narrower folder argument filtering out files the group list assumes are present.","solutions":["List what parallel_tests actually found (run once with --verbose, or `find spec -name '*_spec.rb'`) and copy the exact relative paths","Verify every entry exists before running: `specs.all? { |p| File.exist?(p) }`","Check that --pattern/--exclude-pattern/--suffix are not filtering the listed files, and run from the repo root so relative paths line up"],"exampleFix":"# before\nparallel_test --specify-groups 'user_spec.rb|auth_spec.rb'\n\n# after\nparallel_test --specify-groups 'spec/models/user_spec.rb|spec/requests/auth_spec.rb'","handlingStrategy":"validation","validationCode":"groups = 'spec/models/user_spec.rb|spec/requests/auth_spec.rb'\nmissing = groups.split(/[|,]/).reject { |p| File.exist?(p) }\nabort \"--specify-groups entries not found: #{missing.join(', ')}\" if missing.any?","typeGuard":"def specify_groups_resolvable?(spec_string)\n  spec_string.split(/[|,]/).all? { |p| File.exist?(p) }\nend","tryCatchPattern":"begin\n  ParallelTests::CLI.new.run(args)\nrescue RuntimeError => e\n  if e.message.include?('--specify-groups')\n    # entries went stale: re-list discovered files and diff against the pinned list\n    abort \"stale --specify-groups: #{e.message}\"\n  else\n    raise\n  end\nend","preventionTips":["Generate --specify-groups lists from the file system at run time instead of hardcoding paths","Regenerate pinned group lists in a rake task whenever specs are renamed or moved","Run parallel_tests from the repo root so discovered paths are stable relative paths"],"tags":["ruby","parallel-tests","grouper","specify-groups","file-path","path-mismatch"],"backgroundTag":"file-path-not-found","analyzedSha":"a06047856d3564ee77848e230d61cb6503037ad7","analyzedAt":"2026-08-23T10:12:36.391Z","schemaVersion":2},"datasetVersion":"2026-08-23T13:39:53.451Z"}