Re: pg_upgrade: Make testing different transfer modes easier - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: pg_upgrade: Make testing different transfer modes easier
Date
Msg-id ea5105c4-725d-d37c-e5c7-86926f9ea54a@enterprisedb.com
Whole thread Raw
In response to Re: pg_upgrade: Make testing different transfer modes easier  (Daniel Gustafsson <daniel@yesql.se>)
Responses Re: pg_upgrade: Make testing different transfer modes easier  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
List pgsql-hackers
On 02.12.22 13:04, Daniel Gustafsson wrote:
> Wouldn't it be possible, and less change-code-manual, to accept this via an
> extension to PROVE_FLAGS?  Any options after :: to prove are passed to the
> test(s) [0] so we could perhaps inspect @ARGV for the mode if we invent a new
> way to pass arguments.  Something along the lines of the untested sketch
> below in the pg_upgrade test:
> 
> +# Optionally set the file transfer mode for the tests via arguments to PROVE
> +my $mode = (@ARGV);
> +$mode = '--copy' unless defined;
> 
> .. together with an extension to Makefile.global.in ..
> 
> -   $(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS) $(if $(PROVE_TESTS),$(PROVE_TESTS),t/*.pl)
> +   $(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS) $(if $(PROVE_TESTS),$(PROVE_TESTS),t/*.pl) $(PROVE_TEST_ARGS)
> 
> .. should *I think* allow for passing the mode to the tests via:
> 
> make -C src/bin/pg_upgrade check PROVE_TEST_ARGS=":: --link"

I think this might be a lot of complication to get working robustly and 
in the different build systems.  Plus, what happens if you run all the 
test suites and want to pass some options to pg_upgrade and some to 
another test?

I think if we want to make this configurable on the fly, and environment 
variable would be much easier, like

     my $mode = $ENV{PG_TEST_PG_UPGRADE_MODE} || '--copy';




pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: pg_upgrade: Make testing different transfer modes easier
Next
From: Tom Lane
Date:
Subject: Re: Error-safe user functions