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 end
desc "Smoke-test all projects" desc "Smoke-test all projects"
task :smoke do task :smoke, [:frameworks, :isolated] do |task, args|
(FRAMEWORKS - %w(activerecord)).each do |project| frameworks = args[:frameworks] ? args[:frameworks].split(" ") : FRAMEWORKS
system %(cd #{project} && #{$0} test:isolated --trace) # 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 end
system %(cd activerecord && #{$0} sqlite3:isolated_test --trace)
end end
desc "Install gems for all projects." desc "Install gems for all projects."