Update spec task to preserve simplecov coverage info for previous full spec runs when doing a partial spec run

This commit is contained in:
Josh Holtrop 2017-05-24 16:29:17 -04:00
parent 83226e894d
commit a11fab43cb
3 changed files with 13 additions and 1 deletions

View File

@ -15,6 +15,7 @@ CLOBBER.include %w[pkg]
RSpec::Core::RakeTask.new(:spec, :example_string) do |task, args|
if args.example_string
ENV["partial_specs"] = "1"
task.rspec_opts = %W[-e "#{args.example_string}" -f documentation]
end
end

View File

@ -65,7 +65,13 @@ describe Rscons do
command = %W[ruby -I. -r _simplecov_setup #{@owd}/bin/rscons] + rsconsfile_args + rscons_args
@statics[:build_test_id] ||= 0
@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|
fh.puts <<EOF
require "simplecov"

View File

@ -2,6 +2,11 @@ require "simplecov"
SimpleCov.start do
add_filter "/spec/"
if ENV["partial_specs"]
command_name "RSpec-partial"
else
command_name "RSpec"
end
project_name "Rscons"
merge_timeout 3600
end