-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run tests against supported jRuby versions #4703
Conversation
399124c
to
ba1d3d1
Compare
.travis.yml
Outdated
- jruby-9.0.5.0 | ||
- jruby-9.1.9.0 | ||
- jruby-head | ||
- jruby-1.7.26 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't support jruby-1.7.x https://github.com/bbatsov/rubocop#compatibility
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I removed it from the list.
.travis.yml
Outdated
@@ -3,7 +3,10 @@ cache: bundler | |||
language: ruby | |||
dist: trusty | |||
rvm: | |||
- jruby-9.0.1.0 | |||
- jruby-9.0.5.0 | |||
- jruby-9.1.9.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JRuby 9.1.12 is actually available on Travis CI. For example rails/rails uses it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, updated.
I went based on what is listed on http://rubies.travis-ci.org/. This list doesn't appear to be fully up to date.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's right. I don't know when list of http://rubies.travis-ci.org/
will be updated, but as far as I know Travis CI can use the new JRuby version based on RVM update.
08650c6
to
16683b0
Compare
The build error of JRuby 9.1.12.0 in this PR is probably resolved in #4708. However, there are matrices that can not be tested until the end. It seems that Travis CI terminated due to a timeout of 50 minutes. Below we can see that the build of JRuby 9.1.12.0 is slow. This problem seems to need to be considered separately from the build error. |
Yes, swapping |
.travis.yml
Outdated
@@ -3,7 +3,9 @@ cache: bundler | |||
language: ruby | |||
dist: trusty | |||
rvm: | |||
- jruby-9.0.1.0 | |||
- jruby-9.0.5.0 | |||
- jruby-9.1.12.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update. Just a few hours ago JRuby 9.1.13.0 was released (!) .
http://jruby.org/2017/09/06/jruby-9-1-13-0
This is already available on Travis CI. Would please you update it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This release includes bug fixes for Enumerable#each_with_index
.
jruby/jruby#4724.
My main concern is that the test suit is already pretty slow and adding more builds to the matrix doesn't really help. Why would someone stick with 9.0 instead of upgrading to 9.1? For Rbx and JRuby we've traditionally use on CI just their latest stable version. |
I am not familiar with jRuby's release schedule or their support of major and minor versions. I assumed a jump from 9.0 to 9.1 was similar to minor version updates in Ruby. I am fine removing tests for 9.0. Unfortunately, the jRuby test failures are coming from 9.1 and not 9.0. |
Travis run failure for jRuby 9.1.13.0
I wasn't expecting the error to be running out of memory. I am not sure what baseline memory usage for RuboCop in jRuby is, but 500M seems incredibly high. |
Just ran the jRuby tests locally to compare memory usage. I wound up with 2 Java processes when running |
00ef180
to
d8c64d2
Compare
I am having a bit of trouble getting Does anyone have any thoughts on this? |
@rrosenblum Having a look at this right now. |
@rrosenblum This should get tests passing index ff7a9eda..80e3892b 100644
--- a/lib/rubocop/cop/util.rb
+++ b/lib/rubocop/cop/util.rb
@@ -295,8 +295,7 @@ module RuboCop
end
def compatible_external_encoding_for?(src)
- src = src.dup if RUBY_VERSION < '2.3'
- src.force_encoding(Encoding.default_external).valid_encoding?
+ src.dup.force_encoding(Encoding.default_external).valid_encoding?
end
def to_supported_styles(enforced_style) |
To optimize memory usage, you could instead add another check for |
To clarify my previous comment, this is the simplest patch to get this passing diff --git a/lib/rubocop/cop/util.rb b/lib/rubocop/cop/util.rb
index ff7a9eda..88d5d85b 100644
--- a/lib/rubocop/cop/util.rb
+++ b/lib/rubocop/cop/util.rb
@@ -295,7 +295,7 @@ module RuboCop
end
def compatible_external_encoding_for?(src)
- src = src.dup if RUBY_VERSION < '2.3'
+ src = src.dup if RUBY_VERSION < '2.3' || RUBY_ENGINE == 'jruby'
src.force_encoding(Encoding.default_external).valid_encoding?
end |
Thanks for the help @deivid-rodriguez. The tests passed locally. Hopefully the Travis build will be successful this time. |
🎉 |
You're welcome! 😃 |
.travis.yml
Outdated
@@ -23,6 +24,7 @@ matrix: | |||
- rvm: jruby-9.0.1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The allow_failures
section now contains a non-included matrix item. Remove the line - rvm: jruby-9.0.1.0
.travis.yml
Outdated
matrix: | ||
- 'TASK=spec' | ||
- 'TASK=ascii_spec' | ||
- 'TASK=internal_investigation' | ||
matrix: | ||
allow_failures: | ||
- rvm: jruby-9.0.1.0 | ||
- rvm: jruby-9.1.13.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? jruby-9.0.1.0
was temporarily moved to allow_failures
because of a CI problem unrelated to RuboCop. But it's working now and I think RuboCop still officially supports jruby by making sure it's build is green...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because jruby-9.0.1.0
is not in the list of rubies that are actually run on the CI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean the "plus" part of the diff, not the removal. Why putting jruby-9.1.13.0
in allowed_failures
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same answer. 😛 9.0.1.0
was replaced with 9.1.13.0
in the list of rubies (L:6).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh. I see what you mean now @deivid-rodriguez. Got hung up on the number. Yeah. Should be passing now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get it. We were enforcing jruby to pass when using 9.0.1.0
, then we temporarily removed it because of a CI issue, now we upgrade to 9.1.13.0
and things are working in CI. Shouldn't it be again not present in allowed_failures
?
I understand if you want to split that change to a separate commit, I guess. But the final diff here should not include that in the allowed_failures
list. Unless you'd like that change as a separate PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I would've spared the last comment if I had seen #4703 (comment) before 😄.
Yeah, should be passing now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@deivid-rodriguez Good catch. I wasn't really thinking when I made the change. I agree, since we support jRuby, we should enforce green builds. The build is passing in jRuby so I will remove it from the allowed_failures
section.
Follow up for rubocop#4703. JRuby 9.1.13 and 9.2.0.0-SNAPSHOT (head) are specified for Travis CI. `Dir.tmpdir` on JRuby 9.1.6 or higher returns `/tmp`. It is not the current directory. JRuby 9.1.5 or lower ==================== ```console % cd /home/vagrant && rvm use jruby-9.1.5.0 && ruby -rtmpdir -ve 'p Dir.tmpdir' Using /home/vagrant/.rvm/gems/jruby-9.1.5.0 jruby 9.1.5.0 (2.3.1) 2016-09-07 036ce39 OpenJDK 64-Bit Server VM 24.121-b00 on 1.7.0_121-b00 +jit [linux-x86_64] /home/vagrant/.rvm/rubies/jruby-9.1.5.0/lib/ruby/stdlib/tmpdir.rb:40: warning: shadowing outer local variable - dir "/home/vagrant" ``` JRuby 9.1.6 or higher ===================== ```console % cd /home/vagrant && rvm use jruby-9.1.6.0 && ruby -rtmpdir -ve 'p Dir.tmpdir' Using /home/vagrant/.rvm/gems/jruby-9.1.6.0 jruby 9.1.6.0 (2.3.1) 2016-11-09 0150a76 OpenJDK 64-Bit Server VM 24.121-b00 on 1.7.0_121-b00 +jit [linux-x86_64] "/tmp" ``` I think that this workaround code is unnecessary already. Related Issue ... jruby/jruby#405
Follow up for #4703. JRuby 9.1.13 and 9.2.0.0-SNAPSHOT (head) are specified for Travis CI. `Dir.tmpdir` on JRuby 9.1.6 or higher returns `/tmp`. It is not the current directory. JRuby 9.1.5 or lower ==================== ```console % cd /home/vagrant && rvm use jruby-9.1.5.0 && ruby -rtmpdir -ve 'p Dir.tmpdir' Using /home/vagrant/.rvm/gems/jruby-9.1.5.0 jruby 9.1.5.0 (2.3.1) 2016-09-07 036ce39 OpenJDK 64-Bit Server VM 24.121-b00 on 1.7.0_121-b00 +jit [linux-x86_64] /home/vagrant/.rvm/rubies/jruby-9.1.5.0/lib/ruby/stdlib/tmpdir.rb:40: warning: shadowing outer local variable - dir "/home/vagrant" ``` JRuby 9.1.6 or higher ===================== ```console % cd /home/vagrant && rvm use jruby-9.1.6.0 && ruby -rtmpdir -ve 'p Dir.tmpdir' Using /home/vagrant/.rvm/gems/jruby-9.1.6.0 jruby 9.1.6.0 (2.3.1) 2016-11-09 0150a76 OpenJDK 64-Bit Server VM 24.121-b00 on 1.7.0_121-b00 +jit [linux-x86_64] "/tmp" ``` I think that this workaround code is unnecessary already. Related Issue ... jruby/jruby#405
This is related to #4686. We aren't running tests against all supported jRuby versions. It would be really nice if we could specify
jruby-9.0
andjruby-9.1
to test against the latest versions. I know that we have had issues with the Travis aliases in the past. It seems like we should always run againstjruby-head
even if it is an allowed failure.https://docs.travis-ci.com/user/languages/ruby/
http://rubies.travis-ci.org/