Merge pull request #52101 from ioquatix/fast-smoke-tests

Add support for fast smoke tests.
This commit is contained in:
Rafael Mendonça França 2024-06-12 14:34:25 -04:00 committed by GitHub
commit f805261ede
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 17 additions and 4 deletions

View File

@ -34,11 +34,24 @@ task default: %w(test test:isolated)
end
desc "Smoke-test all projects"
task :smoke do
(FRAMEWORKS - %w(activerecord)).each do |project|
system %(cd #{project} && #{$0} test:isolated --trace)
task :smoke, [:frameworks, :isolated] do |task, args|
frameworks = args[:frameworks] ? args[:frameworks].split(" ") : FRAMEWORKS
# The arguments are positional, and users may want to specify only the isolated flag.. so we allow 'all' as a default for the first argument:
if frameworks.include?("all")
frameworks = FRAMEWORKS
end
isolated = args[:isolated].nil? ? true : args[:isolated] == "true"
test_task = isolated ? "test:isolated" : "test"
(frameworks - ["activerecord"]).each do |project|
system %(cd #{project} && #{$0} #{test_task} --trace)
end
if frameworks.include? "activerecord"
test_task = isolated ? "sqlite3:isolated_test" : "sqlite3:test"
system %(cd activerecord && #{$0} #{test_task} --trace)
end
system %(cd activerecord && #{$0} sqlite3:isolated_test --trace)
end
desc "Install gems for all projects."