postgres icon indicating copy to clipboard operation
postgres copied to clipboard

refactor: DRY extensions NixOS test

Open jfroche opened this issue 3 months ago • 3 comments

Extract common NixOS test node configuration and functions into lib.nix to eliminate duplication across extension tests.

jfroche avatar Nov 11 '25 13:11 jfroche

there are three instances of initdb herein, the first with all the options and the 2nd two with no options. and there's two copies of pg_upgrade. would it make sense to consolidate these into lib.nix as well so there's one definition and every use becomes the same @jfroche ?

hunleyd avatar Nov 11 '25 16:11 hunleyd

there are three instances of initdb herein, the first with all the options and the 2nd two with no options. and there's two copies of pg_upgrade. would it make sense to consolidate these into lib.nix as well so there's one definition and every use becomes the same @jfroche ?

initdb is called as part of the migration script. That migration script can be different from one extension to another, that's why you can see multiple initdb (and the same for pg_upgrade).

jfroche avatar Nov 11 '25 21:11 jfroche

there are three instances of initdb herein, the first with all the options and the 2nd two with no options. and there's two copies of pg_upgrade. would it make sense to consolidate these into lib.nix as well so there's one definition and every use becomes the same @jfroche ?

initdb is called as part of the migration script. That migration script can be different from one extension to another, that's why you can see multiple initdb (and the same for pg_upgrade).

thanks for explaining; makes sense! will review after conflicts are fixed.

hunleyd avatar Nov 12 '25 17:11 hunleyd