mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
add a check for the exit code, so if the exit code is not zero we make the rake task to fail otherwise it pass always causing false positive
move to use exit insted of fail as it aborts the test execution add a comment to clarify why we set the exit code in the rake task Fixes #2920
This commit is contained in:
parent
dbe4154aa6
commit
fb88eef749
1 changed files with 10 additions and 3 deletions
|
@ -1,3 +1,10 @@
|
|||
##
|
||||
# In Logstash we use rspec throw the runner interface so we need to
|
||||
# call explicity to exit in order to set the proper exit code, otherwise
|
||||
# most common CI systems can not know whats up with this tests.
|
||||
# In general this is not a problem, because the most common rspec usage
|
||||
# is throw the rake task, where rspec sets this himself internally.
|
||||
##
|
||||
namespace "test" do
|
||||
def run_rspec(*args)
|
||||
require "logstash/environment"
|
||||
|
@ -8,15 +15,15 @@ namespace "test" do
|
|||
end
|
||||
|
||||
task "core" do
|
||||
run_rspec(Rake::FileList["spec/**/*_spec.rb"])
|
||||
exit run_rspec(Rake::FileList["spec/**/*_spec.rb"])
|
||||
end
|
||||
|
||||
task "core-fail-fast" do
|
||||
run_rspec("--fail-fast", Rake::FileList["spec/**/*_spec.rb"])
|
||||
exit run_rspec("--fail-fast", Rake::FileList["spec/**/*_spec.rb"])
|
||||
end
|
||||
|
||||
task "plugins" do
|
||||
run_rspec("--order", "rand", Rake::FileList[File.join(ENV["GEM_HOME"], "gems/logstash-*/spec/{input,filter,codec,output}s/*_spec.rb")])
|
||||
exit run_rspec("--order", "rand", Rake::FileList[File.join(ENV["GEM_HOME"], "gems/logstash-*/spec/{input,filter,codec,output}s/*_spec.rb")])
|
||||
end
|
||||
|
||||
task "install-core" => ["bootstrap", "plugin:install-core", "plugin:install-development-dependencies"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue