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

chore (sync-service): run filter logic for PG version 15 in unit tests #1672

Merged
merged 4 commits into from
Sep 16, 2024

Conversation

kevin-dp
Copy link
Contributor

This modifies the unit tests to use the publication filter logic for PG 15 as that is more advanced than the logic for version 14 and below.

@kevin-dp kevin-dp requested a review from alco September 11, 2024 15:24
Copy link
Member

@alco alco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works fine locally, but fails on CI when Postgres 14 is used. To fix that CI job, the hard-coded version needs to be replaced by a setting looked up at runtime.

I think it'd be best to add an environment variable POSTGRES_MAJOR_VERSION for both CI jobs and look it up in config/runtime.exs inside a conditional block:

if config_env() == :test do
  config :electric, major_pg_version_for_tests: env!("POSTGRES_MAJOR_VERSION", :integer, 15)
end

Then in the test code you can fetch the setting via Application.fetch_env!(:electric, :major_pg_version_for_tests).

Copy link

netlify bot commented Sep 16, 2024

Deploy Preview for electric-next ready!

Name Link
🔨 Latest commit 5b88611
🔍 Latest deploy log https://app.netlify.com/sites/electric-next/deploys/66e7dea12f06a80008dac301
😎 Deploy Preview https://deploy-preview-1672--electric-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@kevin-dp kevin-dp requested a review from alco September 16, 2024 12:40
Copy link
Member

@alco alco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@kevin-dp kevin-dp merged commit 0b8fbc4 into main Sep 16, 2024
24 checks passed
@kevin-dp kevin-dp deleted the kevin/pg-version-tests branch September 16, 2024 12:46
KyleAMathews pushed a commit that referenced this pull request Nov 1, 2024
#1672)

This modifies the unit tests to use the publication filter logic for PG
15 as that is more advanced than the logic for version 14 and below.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants