* Michael Paquier (michael.paqu...@gmail.com) wrote: > On Sat, Jul 16, 2016 at 4:46 AM, Stephen Frost <sfr...@snowman.net> wrote: > > Going through and doing testing now. Unfortunately, it doesn't look > > like adding in testing of tablespaces into the TAP tests would be very > > easy (the only TAP test that deals with tablespaces that I found was > > pg_basebackup and that looks rather grotty..), so I'm not planning to do > > that, at least not at this time. > > The cleanest way to handle that in PostgresNode would be to have a > dedicated routine calling psql -c 'create tablespace' with tablespaces > located in a folder $basedir/tbspace. And on top of that there should > be the tablespace metadata saved in the context of the test, with a > pair of (tbspc name, location). But I think that we'd need first > stronger arguments (take more use cases) to introduce such an > extension of the test APIs.
The way pg_basebackup handles this is to use TestLib::tempdir_short and create a symlink with it, then to call psql to create the tablespace. I don't have any problem using $basedir/tbspace instead though. What I was thinking is that we'd add a 'create_tablespace' or similar routine to PostgresNode and then make the pg_basebackup and pg_dump tests use it. Otherwise, I suspect the next person who ends up writing a 'create tablespace' into the TAP tests will use yet another location and/or method. Thanks! Stephen
signature.asc
Description: Digital signature