Repository: buildr Updated Branches: refs/heads/master 675e676b9 -> ad5f857a0
Ensure failures in test prerequisites are not swallowed when TEST=all is passed to buildr. A long standing bug existed such that if tests failed to compile, and the option Buildr.options.test is set to :all then the compilation error would not result in a failed build. As many people set the Buildr.options.test to :all in their continuous delivery/integration tools, this has caused some problems. This has been fixed by ensuring all the problems associated with the resolving the prerequisites are not caught when Buildr.options.test is set to :all. Project: http://git-wip-us.apache.org/repos/asf/buildr/repo Commit: http://git-wip-us.apache.org/repos/asf/buildr/commit/ad5f857a Tree: http://git-wip-us.apache.org/repos/asf/buildr/tree/ad5f857a Diff: http://git-wip-us.apache.org/repos/asf/buildr/diff/ad5f857a Branch: refs/heads/master Commit: ad5f857a0fd8b1446abe11eaaceda32fce4e07af Parents: 675e676 Author: Peter Donald <[email protected]> Authored: Fri Jan 30 11:38:18 2015 +1100 Committer: Peter Donald <[email protected]> Committed: Fri Jan 30 11:38:18 2015 +1100 ---------------------------------------------------------------------- CHANGELOG | 7 +++++++ lib/buildr/core/test.rb | 5 +++++ 2 files changed, 12 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/buildr/blob/ad5f857a/CHANGELOG ---------------------------------------------------------------------- diff --git a/CHANGELOG b/CHANGELOG index bd2d31d..851d3f9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,11 @@ 1.4.22 (Pending) +* Fixed: A long standing bug existed such that if tests failed to compile, and the + option Buildr.options.test is set to :all then the compilation error would + not result in a failed build. As many people set the Buildr.options.test to + :all in their continuous delivery/integration tools, this has caused some + problems. This has been fixed by ensuring all the problems associated with + the resolving the prerequisites are not caught when Buildr.options.test is + set to :all. * Change: Update checkstyle to 6.1.1. Submitted by neher. * Fixed: Avoid empty dependency issue in gwt addon if the attempting to gwt compile a project that has no src/main/java. http://git-wip-us.apache.org/repos/asf/buildr/blob/ad5f857a/lib/buildr/core/test.rb ---------------------------------------------------------------------- diff --git a/lib/buildr/core/test.rb b/lib/buildr/core/test.rb index cf26780..8504c75 100644 --- a/lib/buildr/core/test.rb +++ b/lib/buildr/core/test.rb @@ -154,6 +154,11 @@ module Buildr #:nodoc: projects = ([project] + project.projects).select { |project| !(project.test.options[:integration] ^ integration) } projects.each do |project| info "Testing #{project.name}" + # Invoke the prerequisites outside of the rescue block, otherwise errors converging + # the prerequisites are swallowed (and treated like failed test results). Moving the + # code outside means problems such as test code that does not compile will result in a + # build failure even if Buildr.options.test is set to :all + project.test.prerequisites.each{|p|p.is_a?(String) ? file(p).invoke : p.invoke} begin project.test.invoke rescue
