-
Notifications
You must be signed in to change notification settings - Fork 16
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
Tests fail with new bundler on CI #816
Comments
Manuals publisher tests are currently failing, holding up work on this repo. See alphagov/manuals-publisher#816.
alphagov/govuk-content-schemas#555 should be reverted after this is fixed. |
Don't really know what the cause is but it works with bundler 1.12.6 (latest 1.12 series) and fails with bundler 1.13.0 (first in bundler 1.13 series). This might help with tracking it down - although nothing obvious jumps out at me from the bundler changelog. |
You can trigger it by running |
I assume this has been triggered by the upgrade of Bundler for Ruby v2.2.4 from v1.10.6 to v1.14.5 in alphagov/govuk-puppet@857083c. I think the problem is to do with the It looks as if someone attempted a proper fix for this in adacosta/mongoid_rails_migrations#3 6 years ago, but the author didn't seem to understand the problem. I suggest we either find a fork where this has been fixed or implement a new version of that PR in our own fork. |
The problem seems to be: rubygems/bundler#5500. Both cucumber and jasmine-rails fork the ruby process when running their rake tasks and these "nested" bundle exec calls seem to mess up the bundle environment. Note that jasmine-rails only if the RAILS_ENV isn't already test so we can avoid the problem by running |
@h-lame: Do the changes you recommend mean that we end up with "non-standard" rake tasks? Would it not be better to fix the problem in the |
I don't think we should "fix" the rake tasks because we can't really; they need to be run with different arguments. I'm not entirely sure that using a fixed |
Ofc, using a fixed |
This was causing us problems [1] in an application which uses Bundler when we upgraded to Bundler >= v1.13.0. I think the right solution is something along the lines of adacosta#3, but I'm trying this as a temporary quick fix. [1]: alphagov/manuals-publisher#816
* This is an attempt to fix the problem described in #816. It uses a forked version of mongoid_rails_migrations. The branch in that fork was branched off the v1.0.0 tag, which is the version of the gem that was specified in our `Gemfile`. This is so that we keep the changes to our app to a minimum. * This fix is a bit of a bodge - the proper fix would be along the lines of adacosta/mongoid_rails_migrations#3, but given that the failing build is a significant blocker, it feels as if this is worth a try. If it works OK, we can work on getting the proper fix in place. * I installed v1.14.5 of Bundler which is the version now specified in govuk-puppet [1] for Ruby v2.2.4. Hence the change to `BUNDLED WITH` in the `Gemfile`. * I've run a migration locally to ensure that the gem still works OK even with this patch in place. [1]: https://github.com/alphagov/govuk-puppet/blob/e2d61705aaf6da180a781b6f46f83235fd890df0/modules/govuk_rbenv/manifests/all.pp#L46
I've just pushed up a bodgy fix: #822. |
This was causing us problems [1] in an application which uses Bundler when we upgraded to Bundler >= v1.13.0. I think the right solution is something along the lines of adacosta#3, but I'm trying this as a temporary quick fix. Note that this branch is based off the v1.0.0 tag which is the version of the gem that we are currently using in our app. [1]: alphagov/manuals-publisher#816
* This is an attempt to fix the problem described in #816. It uses a forked version of mongoid_rails_migrations. The branch in that fork was branched off the v1.0.0 tag, which is the version of the gem that was specified in our `Gemfile`. This is so that we keep the changes to our app to a minimum. * This fix is a bit of a bodge - the proper fix would be along the lines of adacosta/mongoid_rails_migrations#3, but given that the failing build is a significant blocker, it feels as if this is worth a try. If it works OK, we can work on getting the proper fix in place. * I installed v1.14.5 of Bundler which is the version now specified in govuk-puppet [1] for Ruby v2.2.4. Hence the change to `BUNDLED WITH` in the `Gemfile`. * I've run a migration locally to ensure that the gem still works OK even with this patch in place. [1]: https://github.com/alphagov/govuk-puppet/blob/e2d61705aaf6da180a781b6f46f83235fd890df0/modules/govuk_rbenv/manifests/all.pp#L46
In the short term, we're not planning on trying to improve this fix unless we run into specific problems with it. I'm going to leave this issue open for the moment as a reminder that in the longer run it would be good to come up with a better fix. |
@floehopper: How about opening a new issue to capture any improvement given that this issue has been fixed? |
@chrisroos: Sure. Be my guest. |
I've created issue #874 to remind us that we might want to improve the fix in mongoid_rails_migrations. I can now close this issue. |
This was causing us problems [1] in an application which uses Bundler when we upgraded to Bundler >= v1.13.0. I think the right solution is something along the lines of adacosta#3, but I'm trying this as a temporary quick fix. Note that this branch is based off the v1.0.0 tag which is the version of the gem that we are currently using in our app. [1]: alphagov/manuals-publisher#816
This was causing us problems [1] in an application which uses Bundler when we upgraded to Bundler >= v1.13.0. I think the right solution is something along the lines of these pull requests [2,3], but since these haven't been merged by the maintainer, I'm using this commit as a temporary fix. [1]: alphagov/manuals-publisher#816 [2]: adacosta#3 [3]: adacosta#40
This was causing us problems [1] in an application which uses Bundler when we upgraded to Bundler >= v1.13.0. I think the right solution is something along the lines of these pull requests [2,3], but since these haven't been merged by the maintainer, I'm using this commit as a temporary fix. [1]: alphagov/manuals-publisher#816 [2]: adacosta#3 [3]: adacosta#40
This upgrade from v1.0.0 includes a few changes to improve compatibility with more recent versions of Mongoid and Rails. However, I haven't been able to use the v1.1.0 release version of the gem for three reasons: * Since we're now on Mongoid v6, we need the fix [1] in the latest commit on master in the canonical repo in order for `Mongoid::Migration.connection` method to work. I've incorporated this commit in the new branch in the alphagov fork. * Since we're now on Rails v5, we need a fix [2] for the absence of `alias_method_chain`. I've incorporated the commit from this PR [3] into the new branch in the alphagov fork. * The problem described in #816 still exists. The maintainer of the gem still hasn't fixed the problem. This earlier suggested fix [4] has been closed without explanation. A new fix [5] has been proposed and I've added a comment to explain why I think it should be merged. Therefore I've incorporated my original fix as the last commit in the new branch in the alphagov fork. I've checked that I can generate and run the following migration: class Foo < Mongoid::Migration def self.up p SectionEdition.count p SectionEdition.collection p connection.database.collection_names end def self.down end end I've also updated the existing migration so that I think they would work. However, I haven't tested them. [1]: adacosta/mongoid_rails_migrations@0074dbf [2]: stormz/mongoid_rails_migrations@b9158cd [3]: adacosta/mongoid_rails_migrations#44 [4]: adacosta/mongoid_rails_migrations#3 [5]: adacosta/mongoid_rails_migrations#40
We're seeing these errors on master:
This has also been noted in 0a674b5.
The text was updated successfully, but these errors were encountered: