Skip to content

Commit

Permalink
Sam/oriole17 flake check (#1399)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
samrose and olirice authored Jan 14, 2025
1 parent 82b96e0 commit f9bb095
Show file tree
Hide file tree
Showing 32 changed files with 7,537 additions and 1,590 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/nix-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ jobs:
arch: arm64
- runner: macos-latest
arch: arm64
- runner: macos-13
arch: amd64
runs-on: ${{ matrix.runner }}
timeout-minutes: 180
steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ do $$
declare
extoid oid := (select oid from pg_extension where extname = 'pgmq');
r record;
cls pg_class%rowtype;
begin

set local search_path = '';

/*
Expand Down Expand Up @@ -136,15 +138,36 @@ alter extension pgmq add function pgmq.drop_queue;


update pg_extension set extowner = 'postgres'::regrole where extname = 'pgmq';

for r in (select * from pg_depend where refobjid = extoid) loop


if r.classid = 'pg_type'::regclass then
execute(format('alter type %s owner to postgres;', r.objid::regtype));

-- store the type's relkind
select * into cls from pg_class c where c.reltype = r.objid;

if r.objid::regtype::text like '%[]' then
-- do nothing (skipping array type)

elsif cls.relkind in ('r', 'p', 'f', 'm') then
-- table-like objects (regular table, partitioned, foreign, materialized view)
execute format('alter table pgmq.%I owner to postgres;', cls.relname);

else
execute(format('alter type %s owner to postgres;', r.objid::regtype));

end if;

elsif r.classid = 'pg_proc'::regclass then
execute(format('alter function %s(%s) owner to postgres;', r.objid::regproc, pg_get_function_identity_arguments(r.objid)));

elsif r.classid = 'pg_class'::regclass then
execute(format('alter table %s owner to postgres;', r.objid::regclass));

else
raise exception 'error on pgmq after-create script: unexpected object type %', r.classid;

end if;
end loop;
end $$;
29 changes: 2 additions & 27 deletions ansible/tasks/test-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
- name: Remove specified extensions from SQL file
ansible.builtin.command:
cmd: >
sed -i '/\\ir.*\(timescaledb\|postgis\|pgrouting\|plv8\|pg_jsonschema\|pg_graphql\).*\.sql/d' /tmp/migrations/tests/extensions/test.sql
sed -i '/\\ir.*\(timescaledb\|postgis\|pgrouting\|plv8\).*\.sql/d' /tmp/migrations/tests/extensions/test.sql
when: is_psql_oriole
become: yes

Expand All @@ -76,11 +76,9 @@
paths: /tmp/migrations/tests/extensions
patterns:
- '*timescaledb*.sql'
- '*plv8*.sql'
- '*postgis*.sql'
- '*pgrouting*.sql'
- '*plv8*.sql'
- '*pg_jsonschema*.sql'
- '*pg_graphql*.sql'
register: files_to_remove
when: is_psql_oriole

Expand All @@ -91,29 +89,6 @@
loop: "{{ files_to_remove.files }}"
when: is_psql_oriole
become: yes

- name: Remove specified extensions from SQL file
ansible.builtin.command:
cmd: >
sed -i "/'pg_graphql',/d" /tmp/unit-tests/unit-test-01.sql
when: is_psql_oriole
become: yes

- name: Remove graphql schema test
lineinfile:
path: /tmp/migrations/tests/database/exists.sql
regexp: "^SELECT has_schema\\('graphql'\\);$"
state: absent
become: yes
when: is_psql_oriole

- name: Remove graphql schema test
lineinfile:
path: /tmp/migrations/tests/database/exists.sql
regexp: "^SELECT has_schema\\('graphql_public'\\);$"
state: absent
become: yes
when: is_psql_oriole

- name: Run Unit tests (with filename unit-test-*) on Postgres Database
shell: /usr/bin/pg_prove -U postgres -h localhost -d postgres -v /tmp/unit-tests/unit-test-*.sql
Expand Down
6 changes: 2 additions & 4 deletions ansible/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ async_mode: true

postgres_major:
- "15"
- "16"
- "orioledb-17"

# Full version strings for each major version
postgres_release:
postgresorioledb-17: "17.0.1.017-orioledb"
postgres15: "15.8.1.027"
postgres16: "16.3.1.033"
postgresorioledb-17: "17.0.1.018-orioledb"
postgres15: "15.8.1.028"

# Non Postgres Extensions
pgbouncer_release: "1.19.0"
Expand Down
18 changes: 3 additions & 15 deletions docker/nix/build_nix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,21 @@ fi
SYSTEM=$(nix-instantiate --eval -E builtins.currentSystem | tr -d '"')

nix build .#checks.$SYSTEM.psql_15 -L --no-link
nix build .#checks.$SYSTEM.psql_16 -L --no-link

nix build .#checks.$SYSTEM.psql_orioledb-17 -L --no-link
nix build .#psql_15/bin -o psql_15
nix build .#psql_16/bin -o psql_16

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

# Copy to S3
nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_15
nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_16
if [ "$SYSTEM" != "x86_64-darwin" ]; then
nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_orioledb_17
fi
nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_orioledb_17
if [ "$SYSTEM" = "aarch64-linux" ]; then
nix build .#postgresql_15_debug -o ./postgresql_15_debug
nix build .#postgresql_15_src -o ./postgresql_15_src
nix build .#postgresql_16_debug -o ./postgresql_16_debug
nix build .#postgresql_16_src -o ./postgresql_16_src
nix build .#postgresql_orioledb-17_debug -o ./postgresql_orioledb-17_debug
nix build .#postgresql_orioledb-17_src -o ./postgresql_orioledb-17_src
nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_15_debug-debug
nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_15_src
nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_16_debug-debug
nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_16_src
nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_orioledb-17_debug-debug
nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./postgresql_orioledb-17_src
fi
Loading

0 comments on commit f9bb095

Please sign in to comment.