Skip to content
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

Test PostgreSQL ActiveRecord adapter types #2149

Open
KaanOzkan opened this issue Jan 13, 2025 · 3 comments
Open

Test PostgreSQL ActiveRecord adapter types #2149

KaanOzkan opened this issue Jan 13, 2025 · 3 comments
Labels
gh-actions help-wanted We support this change, and welcome community contributions for it.

Comments

@KaanOzkan
Copy link
Contributor

KaanOzkan commented Jan 13, 2025

Postgres support in Tapioca for ActiveRecordColumns DSL compiler has been slowly increasing https://github.com/search?q=repo%3AShopify%2Ftapioca%20postgresql&type=code. As a result we have untested code paths since we only run an in memory SQLite database during tests. We should have CI setup where we can observe column types under the ActiveRecord::ConnectionAdapters::PostgreSQL namespace.

Questions:

  • Do we need to run postgres to be able to test the ActiveRecord adapter? (It'd be great if we didn't)
  • If we do run postgres, do we need a service container with a postgres image (ex) or is it already available in our image and we can just activate it?
@KaanOzkan KaanOzkan added help-wanted We support this change, and welcome community contributions for it. gh-actions labels Jan 13, 2025
@KaanOzkan KaanOzkan changed the title Test PostgreSQL ActiveRecord adapters Test PostgreSQL ActiveRecord adapter types Jan 13, 2025
@KaanOzkan
Copy link
Contributor Author

cc @alex-tan in case you're interested or have knowledge on the above questions 🙂

@andyw8
Copy link
Contributor

andyw8 commented Jan 13, 2025

That's interesting, normally you would use a separate image for postgres, e.g.:

https://github.com/rails/rails/blob/e7c0592cd2944caf9d70c3fabe9ec6877f1f951b/railties/lib/rails/generators/rails/app/templates/github/ci.yml.tt#L83-L92

If we may need to test against different versions of postgres then the image approach would be more flexible.

@alex-tan
Copy link
Contributor

Agreed! I think the easiest way to test would be to use Docker both for the switching of versions if that ends up being necessary and probably for local development setup as well. It might make sense to use docker-compose to keep things consistent between GitHub actions and local development?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gh-actions help-wanted We support this change, and welcome community contributions for it.
Projects
None yet
Development

No branches or pull requests

3 participants