tembo-io / trunk

Package manager and registry for Postgres extensions
PostgreSQL License
250 stars 14 forks source link

Refactor `pg_config` calls and test pgrx.so #605

Closed theory closed 8 months ago

theory commented 8 months ago

Add pg_config_path(), which handles calls to pg_config, parses the output, and converts it to a PathBuf. Then use it consistently for config directory locations, and use the join() method on the resulting PathBuf structs to test various file locations, rather than use format!().

Then add tests for the installation of the test_pgrx_extension.so and pgrx_with_trunk_toml.so files, to prove that build_pgrx_extension() and build_pgrx_with_trunk_toml() give it different names, and therefore the two tests won't stomp on each other (as was fixed in pull request #604).

Thanks @sjmiller609 for help writing pg_config_path()!