Skip to content

Commit f9bb095

Browse files
samroseolirice
andauthored
Sam/oriole17 flake check (#1399)
* chore: WIP check harness * chore: consolidate start-server/start-client * chore: consolidate start-server, start-client and check harness * chore: rm dup cleanup * chore: do not run pg with overmin, just pg_ctl in daemon mode * chore: deprecate x86_64-darwin and run check on oriole17 * wip toward fixing for all systems * chore: refactoring to create reusable makePostgresDevSetup * chore: tweaks to run-server.sh.in top account for oriole on macos * chore: remove x86_64-darwin support * Isolate failing tests on pg17 and OrioleDB (#1402) * separate pg17 and oriole test diffs * ignore minor diffs in float value * update pgmq after-create script for pg 17 * all tests fixed except interface * sync tests * move postgis_tiger_geocoder to ext_interface * align pg 17 extension interface tests * chore: getting pg tap tests and pg_regress tests to run for pg_15 and oriole 17 * chore: do not build or cache pg 16 for now * chore: wip running pgtap and pgreress tests + rm pg 16 for now * chore: fix tests to account for architecture differences3 * chore: deactivate tests and builds for pg 16 * chore: will pull pg 16 from vars in future pr * chore: update to unit test in ansible build include pg_grapqhl and pg_jsonschema for orioledb * chore: also include pgrouting and postgis in orioledb test * chore: tmp deactivate postgis on this test * chore: rm from list of exts in test too * chore: was missing KEY_FILE var in script * chore: deprecate 16 from versions --------- Co-authored-by: Oliver Rice <github@oliverrice.com>
1 parent 82b96e0 commit f9bb095

32 files changed

+7537
-1590
lines changed

.github/workflows/nix-build.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ jobs:
2424
arch: arm64
2525
- runner: macos-latest
2626
arch: arm64
27-
- runner: macos-13
28-
arch: amd64
2927
runs-on: ${{ matrix.runner }}
3028
timeout-minutes: 180
3129
steps:

ansible/files/postgresql_extension_custom_scripts/pgmq/after-create.sql

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ do $$
22
declare
33
extoid oid := (select oid from pg_extension where extname = 'pgmq');
44
r record;
5+
cls pg_class%rowtype;
56
begin
7+
68
set local search_path = '';
79

810
/*
@@ -136,15 +138,36 @@ alter extension pgmq add function pgmq.drop_queue;
136138

137139

138140
update pg_extension set extowner = 'postgres'::regrole where extname = 'pgmq';
141+
139142
for r in (select * from pg_depend where refobjid = extoid) loop
143+
144+
140145
if r.classid = 'pg_type'::regclass then
141-
execute(format('alter type %s owner to postgres;', r.objid::regtype));
146+
147+
-- store the type's relkind
148+
select * into cls from pg_class c where c.reltype = r.objid;
149+
150+
if r.objid::regtype::text like '%[]' then
151+
-- do nothing (skipping array type)
152+
153+
elsif cls.relkind in ('r', 'p', 'f', 'm') then
154+
-- table-like objects (regular table, partitioned, foreign, materialized view)
155+
execute format('alter table pgmq.%I owner to postgres;', cls.relname);
156+
157+
else
158+
execute(format('alter type %s owner to postgres;', r.objid::regtype));
159+
160+
end if;
161+
142162
elsif r.classid = 'pg_proc'::regclass then
143163
execute(format('alter function %s(%s) owner to postgres;', r.objid::regproc, pg_get_function_identity_arguments(r.objid)));
164+
144165
elsif r.classid = 'pg_class'::regclass then
145166
execute(format('alter table %s owner to postgres;', r.objid::regclass));
167+
146168
else
147169
raise exception 'error on pgmq after-create script: unexpected object type %', r.classid;
170+
148171
end if;
149172
end loop;
150173
end $$;

ansible/tasks/test-image.yml

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
- name: Remove specified extensions from SQL file
6868
ansible.builtin.command:
6969
cmd: >
70-
sed -i '/\\ir.*\(timescaledb\|postgis\|pgrouting\|plv8\|pg_jsonschema\|pg_graphql\).*\.sql/d' /tmp/migrations/tests/extensions/test.sql
70+
sed -i '/\\ir.*\(timescaledb\|postgis\|pgrouting\|plv8\).*\.sql/d' /tmp/migrations/tests/extensions/test.sql
7171
when: is_psql_oriole
7272
become: yes
7373

@@ -76,11 +76,9 @@
7676
paths: /tmp/migrations/tests/extensions
7777
patterns:
7878
- '*timescaledb*.sql'
79+
- '*plv8*.sql'
7980
- '*postgis*.sql'
8081
- '*pgrouting*.sql'
81-
- '*plv8*.sql'
82-
- '*pg_jsonschema*.sql'
83-
- '*pg_graphql*.sql'
8482
register: files_to_remove
8583
when: is_psql_oriole
8684

@@ -91,29 +89,6 @@
9189
loop: "{{ files_to_remove.files }}"
9290
when: is_psql_oriole
9391
become: yes
94-
95-
- name: Remove specified extensions from SQL file
96-
ansible.builtin.command:
97-
cmd: >
98-
sed -i "/'pg_graphql',/d" /tmp/unit-tests/unit-test-01.sql
99-
when: is_psql_oriole
100-
become: yes
101-
102-
- name: Remove graphql schema test
103-
lineinfile:
104-
path: /tmp/migrations/tests/database/exists.sql
105-
regexp: "^SELECT has_schema\\('graphql'\\);$"
106-
state: absent
107-
become: yes
108-
when: is_psql_oriole
109-
110-
- name: Remove graphql schema test
111-
lineinfile:
112-
path: /tmp/migrations/tests/database/exists.sql
113-
regexp: "^SELECT has_schema\\('graphql_public'\\);$"
114-
state: absent
115-
become: yes
116-
when: is_psql_oriole
11792

11893
- name: Run Unit tests (with filename unit-test-*) on Postgres Database
11994
shell: /usr/bin/pg_prove -U postgres -h localhost -d postgres -v /tmp/unit-tests/unit-test-*.sql

ansible/vars.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@ async_mode: true
44

55
postgres_major:
66
- "15"
7-
- "16"
87
- "orioledb-17"
98

109
# Full version strings for each major version
1110
postgres_release:
12-
postgresorioledb-17: "17.0.1.017-orioledb"
13-
postgres15: "15.8.1.027"
14-
postgres16: "16.3.1.033"
11+
postgresorioledb-17: "17.0.1.018-orioledb"
12+
postgres15: "15.8.1.028"
1513

1614
# Non Postgres Extensions
1715
pgbouncer_release: "1.19.0"

docker/nix/build_nix.sh

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,21 @@ fi
99
SYSTEM=$(nix-instantiate --eval -E builtins.currentSystem | tr -d '"')
1010

1111
nix build .#checks.$SYSTEM.psql_15 -L --no-link
12-
nix build .#checks.$SYSTEM.psql_16 -L --no-link
13-
12+
nix build .#checks.$SYSTEM.psql_orioledb-17 -L --no-link
1413
nix build .#psql_15/bin -o psql_15
15-
nix build .#psql_16/bin -o psql_16
1614

17-
# Skip orioledb-17 on x86_64-darwin
18-
if [ "$SYSTEM" != "x86_64-darwin" ]; then
19-
nix build .#psql_orioledb-17/bin -o psql_orioledb_17
20-
fi
15+
nix build .#psql_orioledb-17/bin -o psql_orioledb_17
2116

2217
# Copy to S3
2318
nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_15
24-
nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_16
25-
if [ "$SYSTEM" != "x86_64-darwin" ]; then
26-
nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_orioledb_17
27-
fi
19+
nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_orioledb_17
2820
if [ "$SYSTEM" = "aarch64-linux" ]; then
2921
nix build .#postgresql_15_debug -o ./postgresql_15_debug
3022
nix build .#postgresql_15_src -o ./postgresql_15_src
31-
nix build .#postgresql_16_debug -o ./postgresql_16_debug
32-
nix build .#postgresql_16_src -o ./postgresql_16_src
3323
nix build .#postgresql_orioledb-17_debug -o ./postgresql_orioledb-17_debug
3424
nix build .#postgresql_orioledb-17_src -o ./postgresql_orioledb-17_src
3525
nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_15_debug-debug
3626
nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_15_src
37-
nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_16_debug-debug
38-
nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_16_src
3927
nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_orioledb-17_debug-debug
4028
nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_orioledb-17_src
4129
fi

0 commit comments

Comments
 (0)