Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7ec25d90a04b
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7063ced29d7e
Choose a head ref
  • 3 commits
  • 3 files changed
  • 1 contributor

Commits on Nov 17, 2016

  1. Copy the full SHA
    5909692 View commit details
  2. Copy the full SHA
    5ca8b43 View commit details
  3. Copy the full SHA
    7063ced View commit details
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
## test/template/...##

# source code line numbers are off by one?
CachedViewRenderTest:
- test_render_error_indentation
@@ -871,3 +873,12 @@ UrlHelperTest:
- test_mail_to_with_nil
- test_mail_to_with_special_characters
- test_mail_with_options

## test/actionpack/... ##

RenderTest:
- test_line_offset
- test_render_action_upcased

## test/activerecord/... ##

41 changes: 30 additions & 11 deletions lib/ruby/truffle/jruby-truffle-tool/lib/truffle/config.rb
Original file line number Diff line number Diff line change
@@ -174,11 +174,11 @@ def exclusion_file(gem_name)
data.pretty_inspect
end

def exclusions_for(name)
def exclusions_for(name, ignore_missing: false)
{ setup: { file: { 'excluded-tests.rb' => format(dedent(<<-RUBY), exclusion_file(name)) } } }
failures = %s
require 'truffle/exclude_rspec_examples'
Truffle::Tool.exclude_rspec_examples failures
Truffle::Tool.exclude_rspec_examples failures, ignore_missing: #{!!ignore_missing}
RUBY
end

@@ -245,11 +245,18 @@ def compute_physical_processor_count

Truffle::Tool.add_config :actionview,
deep_merge(rails_common,
exclusions_for(:actionview),
exclusions_for(:actionview, ignore_missing: true),
stubs.fetch(:html_sanitizer))

class Truffle::Tool::CIEnvironment
def rails_ci(has_exclusions: false, skip_test_files: [], require_pattern: 'test/**/*_test.rb')
rails_ci_setup has_exclusions: has_exclusions
set_result rails_ci_run has_exclusions: has_exclusions,
skip_test_files: skip_test_files,
require_pattern: require_pattern
end

def rails_ci_setup(has_exclusions: false)
options = {}
options[:debug] = ['-d', '--[no-]debug', 'Run tests with remote debugging enabled.', STORE_NEW_VALUE, false]
options[:exclude] = ['--[no-]exclusion', 'Exclude known failing tests', STORE_NEW_VALUE, true] if has_exclusions
@@ -260,11 +267,14 @@ def rails_ci(has_exclusions: false, skip_test_files: [], require_pattern: 'test/
use_only_https_git_paths!

has_to_succeed setup
set_result run([*(['--exclude-pattern', *skip_test_files.join('|')] unless skip_test_files.empty?),
'--require-pattern', require_pattern,
*(%w[-r excluded-tests] if has_exclusions && option(:exclude)),
*(%w[--debug] if option(:debug)),
*%w[-- -I test -e nil]])
end

def rails_ci_run(has_exclusions: false, skip_test_files: [], require_pattern: 'test/**/*_test.rb')
run([*(['--exclude-pattern', *skip_test_files.join('|')] unless skip_test_files.empty?),
'--require-pattern', require_pattern,
*(%w[-r excluded-tests] if has_exclusions && option(:exclude)),
*(%w[--debug] if option(:debug)),
*%w[-- -I test -e nil]])
end
end

@@ -342,7 +352,16 @@ def rails_ci(has_exclusions: false, skip_test_files: [], require_pattern: 'test/

Truffle::Tool.add_ci_definition :actionview do
subdir 'actionview'
rails_ci has_exclusions: true,
require_pattern: 'test/template/**/*_test.rb'
# TODO (pitr-ch 17-Nov-2016): run "test/activerecord/*_test.rb" and "test/actionpack/**/*_test.rb" as well, has to be run separately
rails_ci_setup(has_exclusions: true)
results = [
rails_ci_run(has_exclusions: true,
require_pattern: 'test/template/**/*_test.rb'),
rails_ci_run(has_exclusions: true,
require_pattern: 'test/actionpack/**/*_test.rb')
# TODO (pitr-ch 17-Nov-2016): requires ActiveRecord connection to database to run, uses sqlite
# rails_ci_run(has_exclusions: true,
# require_pattern: 'test/activerecord/*_test.rb')
]

set_result results.all?
end
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
module Truffle::Tool

def self.exclude_rspec_examples(exclusions)
def self.exclude_rspec_examples(exclusions, ignore_missing: false)
exclusions.each do |mod_name, tests|

a_module = Object.const_get mod_name.to_s
begin
a_module = Object.const_get mod_name.to_s
rescue NameError => e
puts "Exclusion FAILED of module: #{mod_name}"
if ignore_missing
next
else
raise e
end
end

Array(tests).each do |test|
print "Excluding: #{a_module}##{test}"
@@ -14,6 +22,7 @@ def self.exclude_rspec_examples(exclusions)
end
rescue NameError => e
print ' (NOT FOUND)'
raise e unless ignore_missing
end
puts
end