Skip to content

Commit

Permalink
added counter for tests in an internal has table so we can support du…
Browse files Browse the repository at this point in the history
…plicate names of tests within the same suite
  • Loading branch information
marklubarsky committed Feb 4, 2011
1 parent b83d64c commit 2772fd5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/parallel_tests/queued_test_suite.rb
Expand Up @@ -130,8 +130,10 @@ def flatten_tests(test_suites, exclude_list)
if test.respond_to?(:tests)
adj_tests = ENV['MAX_TEST_CASES_PER_SUITE'].to_i <= test.tests.size ? test.tests[-ENV['MAX_TEST_CASES_PER_SUITE'].to_i..-1] : test.tests
if !exclude_list.include?(test.name)
adj_tests.each do |t|
flattened_test_cases_or_unflattened_suites[0][t.name] = t
duplicated_tests = adj_tests.map(&:name) - adj_tests.map(&:name).uniq
puts "[PROCESS ##{@process_number}] WARNING: found these tests with duplicate names, it's ok will run them all anyway:#{duplicated_tests.uniq.inspect}" unless duplicated_tests.empty?
adj_tests.each_with_index do |t, index|
flattened_test_cases_or_unflattened_suites[0]["#{test.name}::[#{index}]::#{t.name}"] = t
end
else
flattened_test_cases_or_unflattened_suites[1][test.name] = test
Expand Down

0 comments on commit 2772fd5

Please sign in to comment.