-
-
Notifications
You must be signed in to change notification settings - Fork 246
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 Rails 8 #419
base: master
Are you sure you want to change the base?
Add Rails 8 #419
Conversation
@BuonOmo Hi, can you help me with test? |
Yeah, I'm seeing 6 failed tests around these files:
Test result output
If I add them to the Seriously, though, I'd like to try and help out. This is what I've been able to put together so far:
Failure 1 is resolved by updating my local PostgreSQL server to 17 (I was using 14). The Failures 2-5 are all resolved by removing Failure 6 is probably bogus and should be excluded. The difference between expected and actual response is only the addition of "postgis" in the list of available adapters, which is what we fully want/expect. |
@JamesChevalier
|
Yes, I do see those two warnings emitted during the test run as well. There's also this warning prior to the test run:
I'm not completely certain, but I don't think we need to concern ourselves with these particular bits of output. |
Thank you! I made a commit with fix test. I don’t know if it’s necessary to edit rubocop in this MR or if it would be better to open a new one |
I was joking about excluding all the failing tests 😬 |
I thought this was normal. Need a vacation |
@StoneGod I think I have some fixes that you can include. I updated my #419 (comment) with extra details, but here's the short version: Add this to the Create a new Also, you were totally right with your "conter_cache" fixes in |
Can check like this
|
🤦 Thanks for correcting me on how my suggestion gets the gem version, not the PostgreSQL version I tried your example, and got this error: undefined method `server_version' for an instance of ActiveRecord::ConnectionAdapters::ConnectionPool I was able to get |
I removed I don't understand why it help. |
arunit2: | ||
host: <%= ENV["PGHOST"] || "127.0.0.1" %> | ||
port: <%= ENV["PGPORT"] || "5432" %> | ||
database: <%= ENV["PGDATABASE"] || "postgis_adapter_test" %> | ||
username: <%= ENV["PGUSER"] || "postgres" %> | ||
password: <%= ENV["PGPASSWORD"] || "" %> | ||
setup: default | ||
schema_search_path: public |
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 helps with test like
1) Failure:
AsyncBelongsToAssociationsTest#test_async_load_belongs_to [/Users/safin.rr/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/bundler/gems/rails-c694e575cf0f/activerecord/test/cases/associations/belongs_to_associations_test.rb:1871]:
Expected: 1
Actual: 2
But I have no idea why
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.
Not sure either. Looking at the original test it does some filtering of the events based on schema name, so maybe adding this search path adds another unexpected query.
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.
But I don't think this is a big deal to remove
@@ -0,0 +1 @@ | |||
exclude "test_#resolve_raises_if_the_adapter_is_using_the_pre_7.2_adapter_registration_API", TRIAGE_MSG |
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 checked error message
--- expected
+++ actual
@@ -1 +1 @@
-"Database configuration specifies nonexistent 'fake_legacy' adapter. Available adapters are: abstract, fake, mysql2, postgresql, sqlite3, trilogy. Ensure that the adapter is spelled correctly in config/database.yml and that you've added the necessary adapter gem to your Gemfile if it's not in the list of available adapters."
+"Database configuration specifies nonexistent 'fake_legacy' adapter. Available adapters are: abstract, fake, mysql2, postgis, postgresql, sqlite3, trilogy. Ensure that the adapter is spelled correctly in config/database.yml and that you've added the necessary adapter gem to your Gemfile if it's not in the list of available adapters."
@keithdoggett Hi! Can you please show my MR? |
Hi @StoneGod @JamesChevalier thanks for working on the PR. I just approved the test workflow, lets see if tests are running here. I didn't and won't have time soon to review this fully. I guess people that want rails-9 now can point to your branch at first, and contribute if they see failures. Maybe @keithdoggett will have more time even though I doubt it. If it is critical for any of your companies, talk to your bosses and send me an email to discuss support. |
@@ -18,9 +18,9 @@ Gem::Specification.new do |spec| | |||
spec.platform = Gem::Platform::RUBY | |||
|
|||
# ruby-lang.org/en/downloads/branches | |||
spec.required_ruby_version = ">= 3.1.0" | |||
spec.required_ruby_version = ">= 3.2.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.
Shouldn't we keep Support for 3.1 until EOL ? (2025-03-31)
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.
Rails 8 required ruby_version >= 3.2.0
https://rubygems.org/gems/rails
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.
Then, also need to remove ruby 3.1 from the test matrix.
here: https://github.com/rgeo/activerecord-postgis-adapter/blob/master/.github/workflows/tests.yml#L47C9-L47C36
Is anyone using this branch already in production? |
Yes, I used it for the past couple of days and it works just fine. |
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 work on this everyone. Only concern is about that schema dumper test but everything else looks good.
Also we will need to remove old rubies from the CI.
arunit2: | ||
host: <%= ENV["PGHOST"] || "127.0.0.1" %> | ||
port: <%= ENV["PGPORT"] || "5432" %> | ||
database: <%= ENV["PGDATABASE"] || "postgis_adapter_test" %> | ||
username: <%= ENV["PGUSER"] || "postgres" %> | ||
password: <%= ENV["PGPASSWORD"] || "" %> | ||
setup: default | ||
schema_search_path: public |
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.
Not sure either. Looking at the original test it does some filtering of the events based on schema name, so maybe adding this search path adds another unexpected query.
arunit2: | ||
host: <%= ENV["PGHOST"] || "127.0.0.1" %> | ||
port: <%= ENV["PGPORT"] || "5432" %> | ||
database: <%= ENV["PGDATABASE"] || "postgis_adapter_test" %> | ||
username: <%= ENV["PGUSER"] || "postgres" %> | ||
password: <%= ENV["PGPASSWORD"] || "" %> | ||
setup: default | ||
schema_search_path: public |
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.
But I don't think this is a big deal to remove
if ActiveRecord::Base.lease_connection.pool.server_version(ActiveRecord::Base.lease_connection) < 15_00_00 | ||
exclude "test_schema_dumps_unique_constraints", TRIAGE_MSG | ||
end |
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.
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's failing because my local version pg is 14, but I think originally test should check version
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 fails because nulls_not_distinct: true
doesn't exist in the position_4
index in the schema dump. This happens because that is only supported in PostgreSQL 15+ as noted in rails/rails#48608 which added the capability.
I think it makes sense to skip this test if the PostgreSQL version in use happens to be lower than 15 even if we can set that version in CI, because there may be situations like @StoneGod and I experienced where we ran the tests locally in an environment that wasn't using version 15+.
@StoneGod do you need a help with this to finish? |
@januszm Yes, I need help. |
Hello guys!
I'm not sure that all tests are successful; locally a couple fail.
You can run it on CI; if something falls, I’ll figure out why and try to fix it.
Therefore, can I ask to run a CI tests?