rakelib/test.rake
changeset 250 86db38276922
parent 236 5a4e789cdd40
child 254 70c9861ad62f
equal deleted inserted replaced
249:20b718d60bba 250:86db38276922
    82 end
    82 end
    83 
    83 
    84 task :'setup:tasks:test' do
    84 task :'setup:tasks:test' do
    85   $__testresults__ = []
    85   $__testresults__ = []
    86   app = project.application
    86   app = project.application
    87   project.packages.each do |pkg|
    87 
       
    88   # We shuffle the order of the packages by purpose.
       
    89   # Some tests are CPU bound while some are IO bound,
       
    90   # so this should help to distribute the load more evenly
       
    91   # in cases where multiple tests (`rake test` invocations)
       
    92   # are run in parallel (such as on CI)
       
    93   project.packages.shuffle.each do |pkg|
    88     if pkg.test
    94     if pkg.test
    89       task "test:package:#{pkg.name}:pre"
    95       task "test:package:#{pkg.name}:pre"
    90       task "test:package:#{pkg.name}:post"
    96       task "test:package:#{pkg.name}:post"
    91       task "test:package:#{pkg.name}:main" => ['stx:goodies/builder/reports', REPORT_DIR] do
    97       task "test:package:#{pkg.name}:main" => ['stx:goodies/builder/reports', REPORT_DIR] do
    92         report_file = File.expand_path(REPORT_DIR) / "#{pkg.name_components.join('_')}-#{BUILD_ID}-Test.xml"
    98         report_file = File.expand_path(REPORT_DIR) / "#{pkg.name_components.join('_')}-#{BUILD_ID}-Test.xml"
   146   task :summary do
   152   task :summary do
   147     outcome = 'PASSED'
   153     outcome = 'PASSED'
   148     puts
   154     puts
   149     puts 'OVERALL SUMMARY'
   155     puts 'OVERALL SUMMARY'
   150     puts
   156     puts
   151     TestReportSummary::SUMMARIES.each do |test_summary|
   157     (TestReportSummary::SUMMARIES.sort { | a, b | a.pkg <=> b.pkg }).each do |test_summary|
   152       puts "%-20s %s - %d run, %d passed, %d skipped, %d failed, %d errors" % [
   158       puts "%-20s %s - %d run, %d passed, %d skipped, %d failed, %d errors" % [
   153         test_summary.pkg,
   159         test_summary.pkg,
   154         test_summary.outcome,
   160         test_summary.outcome,
   155         test_summary.run,
   161         test_summary.run,
   156         test_summary.passed,
   162         test_summary.passed,