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: 127f0637f972
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: bcaf7fd4a84c
Choose a head ref
  • 3 commits
  • 5 files changed
  • 1 contributor

Commits on Apr 4, 2016

  1. Copy the full SHA
    2f9c36a View commit details
  2. Copy the full SHA
    58a77b3 View commit details
  3. Copy the full SHA
    bcaf7fd View commit details
12 changes: 12 additions & 0 deletions lib/ruby/truffle/jruby+truffle/gem_ci/activemodel.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
subdir 'activemodel'
repository_name 'rails'

git_clone 'https://github.com/rails/rails.git' unless File.exists? repository_dir
git_checkout git_tag('4.2.5.2')

use_only_https_git_paths!

has_to_succeed setup

result run(%w[--require-pattern test/**/*_test.rb -r exclude_tests -- -I test -e nil], raise: false)

1 change: 1 addition & 0 deletions lib/ruby/truffle/jruby+truffle/gem_ci/travis.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
activesupport
activemodel
algebrick
169 changes: 169 additions & 0 deletions lib/ruby/truffle/jruby+truffle/gem_configurations/activemodel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
---
:setup:
:file:
shims.rb: |
#require 'minitest'
# mock load_plugins as it loads rubygems
#def Minitest.load_plugins
#end
require 'active_support'
require 'active_support/testing/isolation'
module ActiveSupport
module Testing
module Isolation
def run
with_info_handler do
time_it do
capture_exceptions do
before_setup; setup; after_setup
skip 'isolation not supported'
end
%w{ before_teardown teardown after_teardown }.each do |hook|
capture_exceptions do
self.send hook
end
end
end
end
return self # per contract
end
end
end
end
require 'active_model'
require 'active_model/secure_password'
module ActiveModel
module SecurePassword
extend ActiveSupport::Concern
module InstanceMethodsOnActivation
def authenticate(unencrypted_password)
password_digest == unencrypted_password && self
end
attr_reader :password
def password=(unencrypted_password)
self.password_digest = unencrypted_password
end
end
end
end
bcrypt.rb: |
puts 'bcrypt stubbed'
module BCrypt
module Password
def self.create(password, *args)
password
end
end
module Engine
MIN_COST = nil
end
end
bundler.rb: "module Bundler; def self.setup; end; end"
# mock method_source gem
# method_source.rb: nil
exclude_tests.rb: |
failures = { AttributeMethodsTest: [:"test_#define_attribute_methods_generates_attribute_methods",
:"test_#define_attribute_methods_generates_attribute_methods_with_spaces_in_their_names",
:"test_#define_attribute_methods_works_passing_multiple_arguments"],
SecurePasswordTest: [:test_Password_digest_cost_can_be_set_to_bcrypt_min_cost_to_speed_up_tests,
:test_Password_digest_cost_defaults_to_bcrypt_default_cost_when_min_cost_is_false,
:test_Password_digest_cost_honors_bcrypt_cost_attribute_when_min_cost_is_false,
:test_create_a_new_user_with_validation_and_a_blank_password_confirmation,
:test_create_a_new_user_with_validation_and_a_spaces_only_password,
:test_create_a_new_user_with_validation_and_an_incorrect_password_confirmation,
:test_create_a_new_user_with_validation_and_password_length_greater_than_72,
:test_setting_a_blank_password_should_not_change_an_existing_password,
:test_updating_an_existing_user_with_validation_and_a_blank_password,
:test_updating_an_existing_user_with_validation_and_a_blank_password_and_password_confirmation,
:test_updating_an_existing_user_with_validation_and_a_blank_password_confirmation,
:test_updating_an_existing_user_with_validation_and_a_spaces_only_password,
:test_updating_an_existing_user_with_validation_and_an_incorrect_password_confirmation,
:test_updating_an_existing_user_with_validation_and_password_length_greater_than_72],
I18nValidationTest: [:test_validates_acceptance_of_finds_custom_model_key_translation_when_accepted,
:test_validates_acceptance_of_finds_custom_model_key_translation_with_interpolation_when_accepted,
:test_validates_acceptance_of_finds_global_default_key_translation_when_accepted,
:test_validates_confirmation_of_finds_custom_model_key_translation_when_confirmation,
:test_validates_confirmation_of_finds_custom_model_key_translation_with_interpolation_when_confirmation,
:test_validates_confirmation_of_finds_global_default_key_translation_when_confirmation,
:test_validates_exclusion_of_finds_custom_model_key_translation_when_exclusion,
:test_validates_exclusion_of_finds_custom_model_key_translation_with_interpolation_when_exclusion,
:test_validates_exclusion_of_finds_global_default_key_translation_when_exclusion,
:test_validates_format_of_finds_custom_model_key_translation_when_invalid,
:test_validates_format_of_finds_custom_model_key_translation_with_interpolation_when_invalid,
:test_validates_format_of_finds_global_default_key_translation_when_invalid,
:test_validates_inclusion_of_finds_custom_model_key_translation_when_inclusion,
:test_validates_inclusion_of_finds_custom_model_key_translation_with_interpolation_when_inclusion,
:test_validates_inclusion_of_finds_global_default_key_translation_when_inclusion,
:test_validates_length_of_finds_custom_model_key_translation_when_too_long,
:test_validates_length_of_finds_custom_model_key_translation_when_too_short,
:test_validates_length_of_finds_custom_model_key_translation_when_wrong_length,
:test_validates_length_of_finds_custom_model_key_translation_with_interpolation_when_too_long,
:test_validates_length_of_finds_custom_model_key_translation_with_interpolation_when_too_short,
:test_validates_length_of_finds_custom_model_key_translation_with_interpolation_when_wrong_length,
:test_validates_length_of_finds_global_default_key_translation_when_too_long,
:test_validates_length_of_finds_global_default_key_translation_when_too_short,
:test_validates_length_of_finds_global_default_key_translation_when_wrong_length,
:test_validates_numericality_of_finds_custom_model_key_translation_when_less_than,
:test_validates_numericality_of_finds_custom_model_key_translation_when_not_a_number,
:test_validates_numericality_of_finds_custom_model_key_translation_when_not_an_integer,
:test_validates_numericality_of_finds_custom_model_key_translation_when_odd,
:test_validates_numericality_of_finds_custom_model_key_translation_with_interpolation_when_less_than,
:test_validates_numericality_of_finds_custom_model_key_translation_with_interpolation_when_not_a_number,
:test_validates_numericality_of_finds_custom_model_key_translation_with_interpolation_when_not_an_integer,
:test_validates_numericality_of_finds_custom_model_key_translation_with_interpolation_when_odd,
:test_validates_numericality_of_finds_global_default_key_translation_when_less_than,
:test_validates_numericality_of_finds_global_default_key_translation_when_not_a_number,
:test_validates_numericality_of_finds_global_default_key_translation_when_not_an_integer,
:test_validates_numericality_of_finds_global_default_key_translation_when_odd,
:test_validates_presence_of_finds_custom_model_key_translation_when_blank,
:test_validates_presence_of_finds_custom_model_key_translation_with_interpolation_when_blank,
:test_validates_presence_of_finds_global_default_key_translation_when_blank],
NumericalityValidationTest: [:test_validates_numericality_with_equal_to] }
p ENV
undefine = if ENV['CI']
failures
else
{}
end
undefine.each do |mod_name, tests|
unless Object.const_defined? mod_name
warn "#{mod_name} not found"
next
end
mod = Object.const_get mod_name
Array(tests).each do |test|
begin
puts "Undefining: #{mod}##{test}"
mod.send :undef_method, test
rescue NoMethodError => e
p e
end
end
end
# do not let bundler to install db gem group
:without:
- db
:run:
:require:
- rubygems
- shims
- openssl-stubs
22 changes: 11 additions & 11 deletions tool/jt.rb
Original file line number Diff line number Diff line change
@@ -465,21 +465,21 @@ def test_integration(*args)
fast = args.delete('fast') || all ||
!long # fast is the default

env_vars = {}
env_vars = {}
env_vars["JRUBY_OPTS"] = '-Xtruffle.graal.warn_unless=false'
env_vars["PATH"] = "#{Utilities.find_jruby_bin_dir}:#{ENV["PATH"]}"
integration_path = "#{JRUBY_DIR}/test/truffle/integration"
long_tests = File.read(File.join(integration_path, 'long-tests.txt')).lines.map(&:chomp)
test_names = args.empty? ? '*' : '{' + args.join(',') + '}'
env_vars["PATH"] = "#{Utilities.find_jruby_bin_dir}:#{ENV["PATH"]}"
integration_path = "#{JRUBY_DIR}/test/truffle/integration"
long_tests = File.read(File.join(integration_path, 'long-tests.txt')).lines.map(&:chomp)
single_test = !args.empty?
test_names = single_test ? '{' + args.join(',') + '}' : '*'

Dir["#{integration_path}/#{test_names}.sh"].each do |test_script|
next if no_gems && File.read(test_script).include?('gem install')
is_long = long_tests.include?(File.basename(test_script))
gem_check = !(no_gems && File.read(test_script).include?('gem install'))
group_check = (is_long && long) || (!is_long && fast)
run = single_test || group_check && gem_check

is_long = long_tests.include?(File.basename(test_script))

if (is_long && long) || (!is_long && fast)
sh env_vars, test_script
end
sh env_vars, test_script if run
end
end
private :test_integration
Original file line number Diff line number Diff line change
@@ -57,7 +57,7 @@ public static MethodFilter by(Visibility visibility) {
case PRIVATE:
return PRIVATE;
default:
throw new UnsupportedOperationException("unsupported visibility: " + visibility);
throw new IllegalArgumentException("unsupported visibility: " + visibility);
}
}