Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

Commit

Permalink
Merge pull request #67 from zopaUK/synchronize-nunit-failed-projects
Browse files Browse the repository at this point in the history
Synchronize access to the failed_projects
  • Loading branch information
lukesmith committed Apr 7, 2016
2 parents a039d32 + bf4e21a commit 7bc97f5
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/bozo/test_runners/nunit.rb
Expand Up @@ -110,24 +110,29 @@ def runner_args(projects = nil, report_prefix = nil)

def execute
if @execute_in_parallel
failed_projects = []
failed_projects = Queue.new
threads = []

@projects.each do |project|
t = Thread.new {
begin
execute_command :nunit, [runner_path] << runner_args([project], "#{project}-#{Time.now.to_i}")
rescue
failed_projects << project
failed_projects.push(project)
end
}
threads.push(t)
end

threads.each(&:join)

if failed_projects.length > 0
raise Bozo::ExecutionError.new(:nunit, [runner_path] << failed_projects, 1)
failed = []
until failed_projects.empty?
failed << failed_projects.pop
end

if failed.length > 0
raise Bozo::ExecutionError.new(:nunit, [runner_path] << failed, 1)
end
else
execute_command :nunit, [runner_path] << runner_args
Expand Down

0 comments on commit 7bc97f5

Please sign in to comment.