>> > Sound about right? I can tidy that up a bit and turn it into a README >> > and >> > add a reference to that to the public tap docs to tell users where to go >> > if >> > they want to write more tests. >> >> Yes, please. > > Will do that now.
This is definitely independent from the efforts of the other patches.
Done.
I got a bit carried away and added:
- src/test/perl/README
- src/test/README
- src/test/modules/README
- POD for src/test/perl/PostgresNode.pm
- $node->info() function (that just returns what dump_info() printed, but as a string
- $node->backup(...) support for passing -R to pg_basebackup
- $node->backup(...) support for passing -X stream to pg_basebackup
- src/test/example_suite/ with some simple demo tests
I found that I was writing documentation for how to write tests that'd bitrot quickly and landed up writing a demo/sample test that can be run as part of 'make check' with --enable-tap-tests instead. Hopefully it's not overkill.
LMK if you think it's too much and I can trim out what's unwanted.
In the process I noticed a few helpers I think should be added to PostgresNode. I haven't added them since I didn't want this to turn into a big patch when it was meant to just be 'add a README', but the main things are:
- promote (you've done this)
- Facilities to make it easier to set a master up as replication-enabled (your patch does this, but it should use wal_level = 'logical' by default IMO; also I think setting autovacuum=off is very wrong and will mask problems)
- wait_for_recovery_lsn($lsn) to wait until a hot standby passes a given LSN
- wait_for_replication_lsn($lsn, $col, $appname) - wait until standby with name $appname (or any standby, if unspecified) passes $lsn for $col, where $col can be 'sent', 'write', 'flush' or 'replay'