Upgrade Citus to v11.3.0 in tests.

Upgrades Citus to v11.3.0 in tests.

This breaks an assumption made by the tests for the `get_source_tables` metadata API, in which data is expected to be ordered. We fix it by explicitly ordering rather than relying on the goodwill of the database.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9039
GitOrigin-RevId: ee86db7e1c264d5009bb0203ac2f3fb2cda7b39f
This commit is contained in:
Samir Talwar 2023-05-04 13:38:31 +02:00 committed by hasura-bot
parent a20c67da30
commit 397e95fc6a
5 changed files with 12 additions and 9 deletions

View File

@ -380,7 +380,7 @@ jobs:
- image: *server_builder_image
- image: hasura/postgres-13.0-alpine-postgis3:latest
<<: *test_pg_env
- image: citusdata/citus:11.2.1
- image: citusdata/citus:11.3.0
<<: *test_citus_env
environment:
# Setting default number of threads to 2

View File

@ -493,7 +493,7 @@ func StartCitusContainer(t TestingT) (string, func()) {
pgopts := &dockertest.RunOptions{
Name: fmt.Sprintf("%s-%s", uniqueName, "pg"),
Repository: "citusdata/citus",
Tag: "11.2.1",
Tag: "11.3.0",
Env: []string{
fmt.Sprintf("POSTGRES_PASSWORD=%s", password),
},

View File

@ -46,7 +46,7 @@ services:
retries: 20
citus:
image: citusdata/citus:11.2.1
image: citusdata/citus:11.3.0
platform: linux/amd64
command:
- -F # turn fsync off for speed

View File

@ -35,7 +35,7 @@ function citus_launch_container {
--volume="${CITUS_VOLUME_NAME}:/var/lib/postgresql/data" \
--env=POSTGRES_PASSWORD="$CITUS_PASSWORD" \
--detach \
citusdata/citus:11.2.1
citusdata/citus:11.3.0
}
function citus_wait {

View File

@ -115,11 +115,12 @@ instance PostgresMetadata 'Vanilla where
JOIN pg_namespace nmsp_child ON nmsp_child.oid = child.relnamespace
) as names
)
SELECT info_schema.table_name, info_schema.table_schema
SELECT info_schema.table_schema, info_schema.table_name
FROM information_schema.tables as info_schema, partitions
WHERE
info_schema.table_schema NOT IN ('information_schema', 'pg_catalog', 'hdb_catalog', '_timescaledb_internal')
AND NOT (info_schema.table_name = ANY (partitions.names))
ORDER BY info_schema.table_schema, info_schema.table_name
|]
instance PostgresMetadata 'Citus where
@ -206,12 +207,13 @@ instance PostgresMetadata 'Citus where
JOIN pg_namespace nmsp_child ON nmsp_child.oid = child.relnamespace
) as names
)
SELECT info_schema.table_name, info_schema.table_schema
SELECT info_schema.table_schema, info_schema.table_name
FROM information_schema.tables as info_schema, partitions
WHERE
info_schema.table_schema NOT IN ('pg_catalog', 'citus', 'information_schema', 'columnar', 'columnar_internal', 'guest', 'INFORMATION_SCHEMA', 'sys', 'db_owner', 'db_securityadmin', 'db_accessadmin', 'db_backupoperator', 'db_ddladmin', 'db_datawriter', 'db_datareader', 'db_denydatawriter', 'db_denydatareader', 'hdb_catalog', '_timescaledb_internal')
AND NOT (info_schema.table_name = ANY (partitions.names))
AND info_schema.table_name NOT IN ('citus_tables')
ORDER BY info_schema.table_schema, info_schema.table_name
|]
instance PostgresMetadata 'Cockroach where
@ -237,11 +239,12 @@ instance PostgresMetadata 'Cockroach where
JOIN pg_namespace nmsp_child ON nmsp_child.oid = child.relnamespace
) as names
)
SELECT info_schema.table_name, info_schema.table_schema
SELECT info_schema.table_schema, info_schema.table_name
FROM information_schema.tables as info_schema, partitions
WHERE
info_schema.table_schema NOT IN ('pg_catalog', 'crdb_internal', 'information_schema', 'columnar', 'guest', 'INFORMATION_SCHEMA', 'sys', 'db_owner', 'db_securityadmin', 'db_accessadmin', 'db_backupoperator', 'db_ddladmin', 'db_datawriter', 'db_datareader', 'db_denydatawriter', 'db_denydatareader', 'hdb_catalog', '_timescaledb_internal', 'pg_extension')
AND NOT (info_schema.table_name = ANY (partitions.names));
AND NOT (info_schema.table_name = ANY (partitions.names))
ORDER BY info_schema.table_schema, info_schema.table_name
|]
----------------------------------------------------------------
@ -280,4 +283,4 @@ instance
runPgSourceReadTx sourceConfig (Query.multiQE fromPGTxErr (listAllTablesSql @pgKind))
`onLeftM` \err -> throwError (prefixQErr "failed to fetch source tables: " err)
pure [QualifiedObject {..} | (qName, qSchema) <- results]
pure [QualifiedObject {..} | (qSchema, qName) <- results]