Update spec task to preserve simplecov coverage info for previous full spec runs when doing a partial spec run
This commit is contained in:
parent
83226e894d
commit
a11fab43cb
@ -15,6 +15,7 @@ CLOBBER.include %w[pkg]
|
|||||||
|
|
||||||
RSpec::Core::RakeTask.new(:spec, :example_string) do |task, args|
|
RSpec::Core::RakeTask.new(:spec, :example_string) do |task, args|
|
||||||
if args.example_string
|
if args.example_string
|
||||||
|
ENV["partial_specs"] = "1"
|
||||||
task.rspec_opts = %W[-e "#{args.example_string}" -f documentation]
|
task.rspec_opts = %W[-e "#{args.example_string}" -f documentation]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -65,7 +65,13 @@ describe Rscons do
|
|||||||
command = %W[ruby -I. -r _simplecov_setup #{@owd}/bin/rscons] + rsconsfile_args + rscons_args
|
command = %W[ruby -I. -r _simplecov_setup #{@owd}/bin/rscons] + rsconsfile_args + rscons_args
|
||||||
@statics[:build_test_id] ||= 0
|
@statics[:build_test_id] ||= 0
|
||||||
@statics[:build_test_id] += 1
|
@statics[:build_test_id] += 1
|
||||||
command_name = "b#{@statics[:build_test_id]}"
|
command_prefix =
|
||||||
|
if ENV["partial_specs"]
|
||||||
|
"p"
|
||||||
|
else
|
||||||
|
"b"
|
||||||
|
end
|
||||||
|
command_name = "#{command_prefix}#{@statics[:build_test_id]}"
|
||||||
File.open("_simplecov_setup.rb", "w") do |fh|
|
File.open("_simplecov_setup.rb", "w") do |fh|
|
||||||
fh.puts <<EOF
|
fh.puts <<EOF
|
||||||
require "simplecov"
|
require "simplecov"
|
||||||
|
@ -2,6 +2,11 @@ require "simplecov"
|
|||||||
|
|
||||||
SimpleCov.start do
|
SimpleCov.start do
|
||||||
add_filter "/spec/"
|
add_filter "/spec/"
|
||||||
|
if ENV["partial_specs"]
|
||||||
|
command_name "RSpec-partial"
|
||||||
|
else
|
||||||
|
command_name "RSpec"
|
||||||
|
end
|
||||||
project_name "Rscons"
|
project_name "Rscons"
|
||||||
merge_timeout 3600
|
merge_timeout 3600
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user