Show version of nodes in output of TAP tests
authorMichael Paquier <[email protected]>
Fri, 5 Dec 2025 00:21:22 +0000 (09:21 +0900)
committerMichael Paquier <[email protected]>
Fri, 5 Dec 2025 00:21:22 +0000 (09:21 +0900)
This commit adds the version information of a node initialized by
Cluster.pm, that may vary depending on the install_path given by the
test.  The code was written so as the node information, that includes
the version number, was dumped before the version number was set.

This is particularly useful for the pg_upgrade TAP tests, that may mix
several versions for cross-version runs.  The TAP infrastructure also
allows mixing nodes with different versions, so this information can be
useful for out-of-core tests.

Backpatch down to v15, where Cluster.pm and the pg_upgrade TAP tests
have been introduced.

Author: Potapov Alexander <[email protected]>
Reviewed-by: Daniel Gustafsson <[email protected]>
Discussion: https://postgr.es/m/e59bb-692c0a80-5-6f987180@170377126
Backpatch-through: 15

src/test/perl/PostgreSQL/Test/Cluster.pm

index c7c74d347a66791cb256e91b966b0bd0f10d94c8..da05ce708db953ee4be0db1ea218a8b71166b2ba 100644 (file)
@@ -1327,10 +1327,10 @@ sub new
      or
      BAIL_OUT("could not create data directory \"$node->{_basedir}\": $!");
 
-   $node->dump_info;
-
    $node->_set_pg_version;
 
+   $node->dump_info;
+
    my $ver = $node->{_pg_version};
 
    # Use a subclass as defined below (or elsewhere) if this version