-
Notifications
You must be signed in to change notification settings - Fork 176
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
Add e2e tests against Rails 6 #537
Conversation
features/fixtures/Gemfile
Outdated
@@ -0,0 +1,13 @@ | |||
# frozen_string_literal: true |
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.
Did you mean to exclude this file? I'm guessing you had it temporarily to run a command to generate a new Rails 6 app.
| 2.4 | 5 | | ||
| 2.5 | 3 | | ||
| 2.5 | 5 | | ||
# | 2.0 | 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.
Did you intend to comment these out? (same question applies to features/rails_features/handled.feature)
@@ -31,6 +31,7 @@ Scenario Outline: Release_stage should default to RAILS_ENV | |||
| 2.4 | 5 | | |||
| 2.5 | 3 | | |||
| 2.5 | 5 | | |||
| 2.5 | 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.
This test is failing for me locally with:
rails6_1 | 2019-04-29T22:17:19.094667096Z Exiting
rails6_1 | 2019-04-29T22:17:19.095071386Z bundler: failed to load command: bin/rails (bin/rails)
rails6_1 | 2019-04-29T22:17:19.095137769Z ArgumentError: Missing `secret_key_base` for 'rails_env' environment, set this string with `rails credentials:edit`
rails6_1 | 2019-04-29T22:17:19.095151232Z /usr/local/bundle/gems/railties-6.0.0.rc1/lib/rails/application.rb:579:in `validate_secret_key_base'
I think you may need to add some things for the "rails_env" environment in your Rails 6 fixture app.
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'm still encountering this failure with the latest commit (5650b60).
Is secret_key_base in config/credentials.yml.enc? Could it be that your working copy passes because it has config/master.key?
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've added a secrets.yml
with base keys, so hopefully that should cover 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.
Now I'm encountering the following failure:
rails6_1 | 2019-05-01T17:52:24.978714700Z #<ActiveRecord::AdapterNotSpecified: The `rails_env` database is not configured for the `rails_env` environment.
rails6_1 | 2019-05-01T17:52:24.978741900Z
rails6_1 | 2019-05-01T17:52:24.978838000Z Available databases configurations are:
rails6_1 | 2019-05-01T17:52:24.978874800Z
rails6_1 | 2019-05-01T17:52:24.978896200Z development
rails6_1 | 2019-05-01T17:52:24.978926100Z test
rails6_1 | 2019-05-01T17:52:24.978957400Z production
rails6_1 | 2019-05-01T17:52:24.978985000Z >
It works/passes if I add a rails_env
section to features/fixtures/rails6/app/config/database.yml
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.
Ok, I've gone through and added all instances of rails_env
AFAICT.
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 latest commit (1c070b2) fails for me for a different reason.
The server start, but the test fails with:
App not ready in time! (RuntimeError)
features/rails_features/release_stage.feature:34:in `And I wait for the app to respond on port "61286"'
features/rails_features/release_stage.feature:12:in `And I wait for the app to respond on port "6128<rails_version>"'
Failing Scenarios:
cucumber features/rails_features/release_stage.feature:34 # Scenario Outline: Release_stage should default to RAILS_ENV, Examples (#13)
log/rails_env.log has:
Started GET "/" for 172.20.0.1 at 2019-05-08 01:19:44 +0000
(0.9ms) SELECT sqlite_version(*)
Notifying http://host.docker.internal:9339 of ActiveRecord::PendingMigrationError
Breadcrumb name trimmed to length 30. Original name: ActiveRecord::PendingMigrationError
ActiveRecord::PendingMigrationError (
Migrations are pending. To resolve this issue, run:
rails db:migrate RAILS_ENV=rails_env
):
activerecord (6.0.0.rc1) lib/active_record/migration.rb:587:in `check_pending!'
activerecord (6.0.0.rc1) lib/active_record/migration.rb:564:in `call'
actionpack (6.0.0.rc1) lib/action_dispatch/middleware/stack.rb:57:in `block in call'
If I change the rails_env
section in features/fixtures/rails6/app/config/database.yml to use db/development.sqlite3 (similar to the other Rails fixture apps), it works (but I haven't figured out why yet).
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.
It migrates in the build before the RIALS_ENV is set, they should all point to the same database
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.
lgtm after adding a rails_env section to features/fixtures/rails6/app/config/database.yml
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.
lgtm as the Rails 6 tests in features/rails_features/release_stage.feature now pass on my machine
Goal
Ensure Bugsnag ruby functionality works as expected on Rails 6
All scenarios are covered with one exception: MongoBreadcrumbs, as MongoID don't have a Gem released that supports Rails 6 at the moment.
As a note, many of the tests against previous rails versions are failing due to conflicts when installing Gems, I intend to fix that in a separate PR.