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 on PG 11 and 12 #401

Merged
merged 3 commits into from
Jan 26, 2021
Merged

🐘 Test on PG 11 and 12 #401

merged 3 commits into from
Jan 26, 2021

Conversation

rowanseymour
Copy link
Contributor

No description provided.

psql -h localhost -U postgres -c "CREATE USER mailroom_test PASSWORD 'temba';"
psql -h localhost -U postgres -c "ALTER ROLE mailroom_test WITH SUPERUSER;"
psql -h localhost -U postgres -c "CREATE DATABASE mailroom_test;"
export PGPASSWORD=temba
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The docker image with postgres is now postgis:postgis instead of mdillon:postgis and it seems this new one doesn't set POSTGRES_HOST_AUTH_METHOD=trust so you need to set a password for the superuser account and then set it here as an env for psql to use.

@codecov
Copy link

codecov bot commented Jan 25, 2021

Codecov Report

Merging #401 (2289160) into master (bacf9dc) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #401   +/-   ##
=======================================
  Coverage   55.17%   55.17%           
=======================================
  Files         115      115           
  Lines        7956     7956           
=======================================
  Hits         4390     4390           
  Misses       2866     2866           
  Partials      700      700           
Impacted Files Coverage Δ
core/models/channel_connection.go 22.29% <ø> (ø)
core/models/orgs.go 55.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bacf9dc...2289160. Read the comment docs.

@@ -251,6 +251,9 @@ WHERE
cc.channel_id = $1 AND
cc.connection_type = $2 AND
cc.external_id = $3
ORDER BY
cc.id DESC
LIMIT 1
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nicpottier TestTwilioIVR was failing for PG 12 but after much debugging and thinking oh crap we've written some incompatible SQL somewhere it seems it's a case of SelectChannelConnectionByExternalID "always" returning the last of multiple matching connections when tests run under PG 10 and 11, but the first for PG 12. I don't understand the IVR stuff well enough yet to know if it should be matching multiple connections, but this at least makes the assumed behavior explicit.

@@ -264,7 +264,7 @@ SELECT ROW_TO_JSON(o) FROM (SELECT
(SELECT CASE is_anon WHEN TRUE THEN 'urns' WHEN FALSE THEN 'none' END) AS redaction_policy,
$2::int AS max_value_length,
(SELECT iso_code FROM orgs_language WHERE id = o.primary_language_id) AS default_language,
(SELECT ARRAY_AGG(iso_code) FROM orgs_language WHERE org_id = o.id) AS allowed_languages,
(SELECT ARRAY_AGG(iso_code ORDER BY iso_code ASC) FROM orgs_language WHERE org_id = o.id) AS allowed_languages,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

also was causing failing test due to non-deterministic language ordering

@rowanseymour rowanseymour changed the title Test on PG 12 🐘 Test on PG 11 and 12 Jan 25, 2021
@rowanseymour rowanseymour merged commit 14b5823 into master Jan 26, 2021
@rowanseymour rowanseymour deleted the pg12 branch January 26, 2021 13:59
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.

1 participant