mirror of https://github.com/rails/rails
Don't run the adapter tests when a test selection is made
If `bin/test file_to_test.rb` is called, we should not be running all the test for that adapter, only the test file we selected.
This commit is contained in:
parent
3efe5e21b8
commit
90f4b3d96e
|
@ -11,11 +11,13 @@ require "active_support"
|
||||||
require "active_support/test_case"
|
require "active_support/test_case"
|
||||||
|
|
||||||
require "rake/testtask"
|
require "rake/testtask"
|
||||||
|
|
||||||
Rails::TestUnit::Runner.singleton_class.prepend Module.new {
|
Rails::TestUnit::Runner.singleton_class.prepend Module.new {
|
||||||
private
|
private
|
||||||
def list_tests(argv)
|
def list_tests(patterns)
|
||||||
tests = super
|
tests = super
|
||||||
tests.concat FileList["test/cases/adapters/#{adapter_name}/**/*_test.rb"]
|
tests.concat FileList["test/cases/adapters/#{adapter_name}/**/*_test.rb"] if patterns.empty?
|
||||||
|
tests
|
||||||
end
|
end
|
||||||
|
|
||||||
def default_test_exclude_glob
|
def default_test_exclude_glob
|
||||||
|
|
|
@ -45,7 +45,8 @@ module Rails
|
||||||
end
|
end
|
||||||
|
|
||||||
def load_tests(argv)
|
def load_tests(argv)
|
||||||
tests = list_tests(argv)
|
patterns = extract_filters(argv)
|
||||||
|
tests = list_tests(patterns)
|
||||||
tests.to_a.each { |path| require File.expand_path(path) }
|
tests.to_a.each { |path| require File.expand_path(path) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -96,9 +97,7 @@ module Rails
|
||||||
PATH_ARGUMENT_PATTERN.match?(arg)
|
PATH_ARGUMENT_PATTERN.match?(arg)
|
||||||
end
|
end
|
||||||
|
|
||||||
def list_tests(argv)
|
def list_tests(patterns)
|
||||||
patterns = extract_filters(argv)
|
|
||||||
|
|
||||||
tests = Rake::FileList[patterns.any? ? patterns : default_test_glob]
|
tests = Rake::FileList[patterns.any? ? patterns : default_test_glob]
|
||||||
tests.exclude(default_test_exclude_glob) if patterns.empty?
|
tests.exclude(default_test_exclude_glob) if patterns.empty?
|
||||||
tests
|
tests
|
||||||
|
|
Loading…
Reference in New Issue