-
-
Notifications
You must be signed in to change notification settings - Fork 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
Fix 3-9-maintenance CI failures #2360
Conversation
2c3d278
to
5d92bd6
Compare
Its fine to bump Rubies to the latest versions permanently if you want |
c093039
to
9f9132d
Compare
I'm getting this when installing 2.2.10 with rvm, and remains in that condition, same error when running
|
This comment has been minimized.
This comment has been minimized.
For 2.2.10 and 2.3.8 and earlier, found here: brew install rbenv/tap/openssl@1.0
PKG_CONFIG_PATH=/usr/local/Cellar/openssl@1.0/1.0.2t/lib/pkgconfig rvm install 2.2.10 --with-openssl-dir=/usr/local/Cellar/openssl@1.0/1.0.2t --with-openssl-lib=/usr/local/Cellar/openssl@1.0/1.0.2t/lib --with-openssl-include=/usr/local/Cellar/openssl@1.0/1.0.2t/include --rubygems ignore |
Yeah I had to use rvm's custom install for open ssl which installs to a special folder then use that |
Confused by this example: it 'is accessible to hooks', pending: pending_only_on_ruby_22_rails_52 do
with_isolated_config do
run_count = 0
RSpec.configuration.before(:each, type: :view) do
allow(view).to receive(:render) { :value }
run_count += 1
end
group = RSpec::Core::ExampleGroup.describe 'a view', type: :view do
specify { expect(true).to eq true }
end
group.run(failure_reporter)
expect(failure_reporter.exceptions).to eq []
expect(run_count).to eq 1
end
end Firstly, this spec passes as a whole, but if you focus on this example, it fails on all Ruby versions.
Also fails on latest released 5.2.4.3. |
Another confusion is (ok, solved) is related to our It seems we're using
Hard to argue with that. And easy to fix. I'm not sure if it's worth it to add a note on how to set
|
The third confusion is this spec itself. I'm struggling to understand what does it test exactly, and I have no good idea. |
The fourth confusion is how it manages to work when it works, given: def add_hook_to_existing_matching_groups(meta, scope, &block)
if scope == :example || scope == :each || scope.nil?
world.example_groups.each(&block) So the trick is to add this hook to all known top-level-groups (wondering what the impact is for thousands of tl-groups and dozens of hooks). So I thought that putting the group declaration before hook definition will work, but it doesn't, as it doesn't add a tl-group: RSpec::Core::ExampleGroup.describe('a view') { it { } }
RSpec.configuration.world.example_groups # => [] I'm running it on Ruby 2.5.1 and Rails 5.2.4.3. |
The fifth confusion is why it fails when focused, while passes just fine along with the whole spec. |
It seems that those two live in two different worlds: 2308: if scope == :example || scope == :each || scope.nil?
2309: require 'pry'; binding.pry
=> 2310: world.example_groups.each(&block)
2311: else
[1] pry(#<RSpec::Core::Configuration>)> RSpec.world.example_groups
=> [RSpec::ExampleGroups::AView]
[2] pry(#<RSpec::Core::Configuration>)> world.example_groups
=> [] and |
Ok, I now understand the spec in question more or less. After fixing the issue with different worlds I'm still able to reproduce the focused failure. |
I guess the focusing issue is due to the example created with |
449dc45
to
639ad76
Compare
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.
Some fixes could come handy in 4.0, leaving notes to forward-port them to master
.
Dependency problems became apparent on CI when I've dropped the CI build cache for this PR and 3-9-maintenance
branch. Bundler started querying anew just like it does locally.
I'm giving up on this stubborn view spec. Can't reproduce it locally (well, it fails when focused, but for another reason). It's stable red on CI. I intend to mute it for this specific Ruby and Rails combination that it fails for.
Apart from this, Rails 3.x 3.0 and 3.1 builds are failing due to Bundler unable to resolve dependencies. I'm going to address this later in the day.
spec/support/helpers.rb
Outdated
@@ -4,6 +4,7 @@ module Helpers | |||
def with_isolated_config | |||
original_config = RSpec.configuration | |||
RSpec.configuration = RSpec::Core::Configuration.new | |||
RSpec.configuration.world = RSpec.world |
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.
TODO: forward-port me
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 it was needed?
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.
Otherwise, the two worlds are out of sync inside with_isolated_config
:
with_isolated_config do
RSpec::Core::ExampleGroup.describe('a view') { it { } }
RSpec.configuration.world.example_groups # => []
end
without with_isolated_config
:
RSpec::Core::ExampleGroup.describe('a view') { it { } }
RSpec.configuration.world.example_groups # => [<Example ...>]
I got rid of with_isolated_config
in this example, so this change is to make with_isolated_config
more future-proof.
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.
If this doesn't fix a failing spec I'm going to say we should leave this as it was on this branch at least.
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.
Removed. Let's see if it affects the build. At least it this change doesn't seem to affect view_example_group_spec.rb
on 2.2.10/5.2.4.3.
@@ -11,11 +11,11 @@ if is_ruby_23_plus; then | |||
yes | gem install bundler | |||
else | |||
echo "Warning installing older versions of Rubygems / Bundler" | |||
gem update --system '2.7.8' | |||
gem update --system '2.7.10' | |||
gem install bundler -v '1.17.3' |
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 didn't know those two are incapable of finding a matching gem version given a Ruby version constraint 😖
spec/support/helpers.rb
Outdated
@@ -4,6 +4,7 @@ module Helpers | |||
def with_isolated_config | |||
original_config = RSpec.configuration | |||
RSpec.configuration = RSpec::Core::Configuration.new | |||
RSpec.configuration.world = RSpec.world | |||
RSpec::Rails.initialize_configuration(RSpec.configuration) | |||
yield RSpec.configuration |
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.
Do we even need to yield it?
We use |config|
, but we could equally use RSpec.configuration
in those specs. At least I was confused, I thought that at some point config
was out of sync with RSpec.configuration
.
6916a29
to
839bce4
Compare
Could not find gem 'puma' in https://github.com/rails/rails.git (at 5-2-stable@92fd1c2). The source does not contain any versions of 'puma'
In this example, we're making sure that `view` is available in global config hooks. `group.run` accepts a reporter, but it defaults to a NullReporter anyway.
2.2 support has been dropped from 1.5.2 https://rubygems.org/gems/i18n/versions/1.5.2 https://rubygems.org/gems/i18n/versions/1.5.1
When installed from scratch on 2.2.10 with RubyGems 2.3.10 and Bundler 1.17.3, with RAILS_VERSION set to `5-2-stable`: childprocess-3.0.0 requires ruby version >= 2.3.0, which is incompatible with the current version, ruby 2.2.10p489 xpath-3.2.0 requires ruby version >= 2.3, which is incompatible with the current version, ruby 2.2.10p489 i18n-1.8.3 requires ruby version >= 2.3.0, which is incompatible with the current version, ruby 2.2.10p489 nio4r-2.5.2 requires ruby version >= 2.3, which is incompatible with the current version, ruby 2.2.10p489 rack-2.2.3 requires ruby version >= 2.3.0, which is incompatible with the current version, ruby 2.2.10p489 public_suffix-4.0.5 requires ruby version >= 2.3, which is incompatible with the current version, ruby 2.2.10p489 rubyzip-2.3.0 requires ruby version >= 2.4, which is incompatible with the current version, ruby 2.2.10p489 sprockets-4.0.2 requires ruby version >= 2.5.0, which is incompatible with the current version, ruby 2.2.10p489 We had sprockets capped, but only for `'~> x.x.x'`/`x.x.x` formats.
`set -e` stops the script when a *simple command* fails. If the command is part of an `||`-expression, the script continues. It seems unessential that we fail to uninstall `bundler` from the global gemset, the build is green after all.
actionpack was resolved to 3.2.22.5, which depends on sprockets (~> 2.2.1)
Warning: unrecognized cop BinaryOperatorParameterName found in /home/travis/build/rspec/rspec-rails/.rubocop_rspec_base.yml
RucoCop on CI is fixed at 0.23, and has outdated cop names. Even without those disabling, `rubocop lib` passes just fine.
Gem::RuntimeRequirementNotMetError: public_suffix requires Ruby version >= 1.9.3. The current ruby version is 1.8. An error occurred while installing public_suffix (1.4.2), and Bundler cannot continue. Gem::RuntimeRequirementNotMetError: redcarpet requires Ruby version >= 1.9.2. The current ruby version is 1.8. An error occurred while installing redcarpet (3.1.1), and Bundler cannot continue. Gem::RuntimeRequirementNotMetError: rubyzip requires Ruby version >= 1.9.2. The current ruby version is 1.8. An error occurred while installing rubyzip (1.0.0), and Bundler cannot continue.
Update to the latest released Rails 5.2.4.3 didn't help, it still has the bug. Backported from https://github.com/rspec/rspec-rails/blob/c0a8c22186a1232e3b1612c44bc88052ec56c945/spec/rspec/rails/example/view_example_group_spec.rb#L239
For the reasons described in the comment
bundle exec rails new ./tmp/example_app --no-rc --skip-javascript --skip-bootsnap --skip-sprockets --skip-git --skip-test-unit --skip-listen --skip-bundle --template=example_app_generator/generate_app.rb Gem::RuntimeRequirementNotMetError: spring requires Ruby version >= 2.4.0. The current ruby version is 2.3.0. An error occurred while installing spring (2.1.0), and Bundler cannot continue.
ffi has strict Ruby constraints aruba: Bundler could not find compatible versions for gem "thor": In Gemfile: aruba (~> 0.14.11) was resolved to 0.14.12, which depends on thor (~> 0.19) rails (~> 3.1.12) was resolved to 3.1.12, which depends on railties (= 3.1.12) was resolved to 3.1.12, which depends on thor (~> 0.14.6)
https://github.com/rspec/rspec-rails/pull/2140/files#diff-73c25cf975ccb4c89d8659202506c353L58 bumped aruba from 0.5.4 straight to 0.14.12. Using the version that used to work for older rails.
There's a minor difference: Widget management User creates a new widget -1 example, 0 failures, 1 pending +1 example, 0 failures most probably caused by 5-2-stable vs 5.2.4.x spec generation difference.
9c1b28d
to
a8dd5e1
Compare
Ruby 1.9.2 segfaults time to time. Usually
Restarting usually helps. Maybe add it to allowed failures as well? |
No because then we are not notified of legitimate 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.
All good apart from Aruba, I'd like the comment to mention why a specific version is used if its used, but you can add that as a seperate commit with a [ci skip]
if you'd like to avoid the rebuild time.
Co-authored-by: Jon Rowe <[email protected]>
CI builds for
3-9-maintenance
branch fail.Some failures are constant, like for earlier Rubies:
or
or
to a complete nonsense in newer Rubies
Example builds: [1, 2].
master
/4-0-maintenance