Skip to content

Commit

Permalink
Add a spec:ruby:fast target that avoids subprocess-spawning specs.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Sep 16, 2014
1 parent 769b2c3 commit 43b4a25
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rakelib/commands.rake
Expand Up @@ -93,7 +93,7 @@ def mspec(mspec_options = {}, java_options = {}, &code)
sysproperty :key => "emma.verbosity.level", :value=> "silent"

env :key => "JAVA_OPTS", :value => "-Demma.verbosity.level=silent"
env :key => "JRUBY_OPTS", :value => ""
env :key => "JRUBY_OPTS", :value => ms[:jruby_opts] || ""
# launch in the same mode we're testing, since config is loaded by top process

# add . to load path so mspec config is found
Expand All @@ -115,6 +115,7 @@ def mspec(mspec_options = {}, java_options = {}, &code)
arg :line => "-T -J-XX:MaxPermSize=512M" if ENV_JAVA["java.version"] !~ /\A1\.8/
arg :line => "-f #{ms[:format]}"
arg :line => "-B #{ms[:spec_config]}" if ms[:spec_config]
arg :line => "#{ms[:spec_target]}" if ms[:spec_target]
end
end

Expand Down
8 changes: 8 additions & 0 deletions rakelib/rubyspec.rake
Expand Up @@ -13,6 +13,14 @@ namespace :spec do
desc "Run rubyspecs expected to pass in precompiled mode"
task :'ruby:aot' => :ci_precompiled

desc "Run fast specs that do not spawn many subprocesses"
task :'ruby:fast' do
mspec :compile_mode => "OFF",
:format => 'd',
:spec_target => ":fast",
:jruby_opts => "--dev"
end

desc "Run rubyspecs expected to pass"
task :ci => ['spec:tagged']

Expand Down
21 changes: 21 additions & 0 deletions spec/jruby.2.1.mspec
Expand Up @@ -26,6 +26,27 @@ class MSpecScript
'^' + SPEC_DIR + '/core/encoding/converter'
]

set :fast, [
*get(:language),
*get(:core),

# These all spawn sub-rubies, making them very slow to run
'^' + SPEC_DIR + '/core/process',
'^' + SPEC_DIR + '/core/kernel/exec',
'^' + SPEC_DIR + '/core/kernel/spawn',
'^' + SPEC_DIR + '/core/io/popen',
'^' + SPEC_DIR + '/core/argf/gets_spec.rb',
'^' + SPEC_DIR + '/core/argf/read_spec.rb',
'^' + SPEC_DIR + '/core/argf/readline_spec.rb',
'^' + SPEC_DIR + '/core/encoding/default_external_spec.rb',
'^' + SPEC_DIR + '/core/encoding/default_internal_spec.rb',
'^' + SPEC_DIR + '/core/io/pid_spec.rb',
'^' + SPEC_DIR + '/core/kernel/at_exit_spec.rb',
'^' + SPEC_DIR + '/language/encoding_spec.rb',
'^' + SPEC_DIR + '/language/predefined_spec.rb',
'^' + SPEC_DIR + '/language/predefined/data_spec.rb',
]

# Filter out ObjectSpace specs if ObjectSpace is disabled
unless JRuby.objectspace
get(:core) << '^' + SPEC_DIR + '/core/objectspace/_id2ref'
Expand Down

0 comments on commit 43b4a25

Please sign in to comment.