Re: Adding CI to our tree
Justin Pryzby <pryzby@telsasoft.com>
On Sun, Feb 13, 2022 at 01:53:19PM -0800, Andres Freund wrote:
> Hi,
>
> On 2022-02-13 15:31:20 -0600, Justin Pryzby wrote:
> > Oh - I suppose you're right. That's an unfortunate consequence of running a
> > single prove instance without chdir.
>
> I don't think it's chdir that's relevant (that changes into the source
> directory after all). It's the TESTDIR environment variable.
>
> I was thinking that we should make Utils.pm's INIT block responsible for
> figuring out both the directory a test should run in and the log location,
> instead having that in vcregress.pl and Makefile.global.in. Mostly because
> doing it in the latter means we can't start tests with different TESTDIR and
> working dir at the same time.
>
> If instead we pass the location of the top-level build and top-level source
> directory from vcregress.pl / Makefile.global, the tap test infrastructure can
> figure out that stuff themselves, on a per-test basis.
>
> For msvc builds we probably would need to pass in some information that allow
> Utils.pm to set up PATH appropriately. I think that might just require knowing
> that a) msvc build system is used b) Release vs Debug.
I'm totally unsure if this resembles what you're thinking of, and I'm surprised
I got it working so easily. But it gets the tap test output in separate dirs,
and CI is passing for everyone (windows failed because I injected a "false" to
force it to upload artifacts).
https://github.com/justinpryzby/postgres/runs/5211673291
commit 899e562102dd7a663cb087cdf88f0f78f8302492
Author: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Tue Feb 15 20:02:36 2022 -0600
wip: set TESTDIR from src/test/perl rather than Makefile/vcregress
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index 05c54b27def..1e49d8c8c37 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -450,7 +450,7 @@ define prove_installcheck
rm -rf '$(CURDIR)'/tmp_check
$(MKDIR_P) '$(CURDIR)'/tmp_check
cd $(srcdir) && \
- TESTDIR='$(CURDIR)' PATH="$(bindir):$(CURDIR):$$PATH" \
+ PATH="$(bindir):$(CURDIR):$$PATH" \
PGPORT='6$(DEF_PGPORT)' top_builddir='$(CURDIR)/$(top_builddir)' \
PG_REGRESS='$(CURDIR)/$(top_builddir)/src/test/regress/pg_regress' \
$(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS) $(if $(PROVE_TESTS),$(PROVE_TESTS),t/*.pl)
@@ -460,7 +460,7 @@ define prove_installcheck
rm -rf '$(CURDIR)'/tmp_check
$(MKDIR_P) '$(CURDIR)'/tmp_check
cd $(srcdir) && \
- TESTDIR='$(CURDIR)' PATH="$(bindir):$(CURDIR):$$PATH" \
+ PATH="$(bindir):$(CURDIR):$$PATH" \
PGPORT='6$(DEF_PGPORT)' top_builddir='$(top_builddir)' \
PG_REGRESS='$(top_builddir)/src/test/regress/pg_regress' \
$(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS) $(if $(PROVE_TESTS),$(PROVE_TESTS),t/*.pl)
@@ -471,7 +471,7 @@ define prove_check
rm -rf '$(CURDIR)'/tmp_check
$(MKDIR_P) '$(CURDIR)'/tmp_check
cd $(srcdir) && \
- TESTDIR='$(CURDIR)' $(with_temp_install) PGPORT='6$(DEF_PGPORT)' \
+ $(with_temp_install) PGPORT='6$(DEF_PGPORT)' \
PG_REGRESS='$(CURDIR)/$(top_builddir)/src/test/regress/pg_regress' \
$(PROVE) $(PG_PROVE_FLAGS) $(PROVE_FLAGS) $(if $(PROVE_TESTS),$(PROVE_TESTS),t/*.pl)
endef
diff --git a/src/bin/psql/t/010_tab_completion.pl b/src/bin/psql/t/010_tab_completion.pl
index 005961f34d4..a86dc78a365 100644
--- a/src/bin/psql/t/010_tab_completion.pl
+++ b/src/bin/psql/t/010_tab_completion.pl
@@ -70,7 +70,7 @@ delete $ENV{LS_COLORS};
# to run in the build directory so that we can use relative paths to
# access the tmp_check subdirectory; otherwise the output from filename
# completion tests is too variable.
-if ($ENV{TESTDIR})
+if ($ENV{TESTDIR} && 0)
{
chdir $ENV{TESTDIR} or die "could not chdir to \"$ENV{TESTDIR}\": $!";
}
diff --git a/src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl b/src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl
index facfec5cad4..2a0eca77440 100644
--- a/src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl
+++ b/src/test/modules/libpq_pipeline/t/001_libpq_pipeline.pl
@@ -49,9 +49,7 @@ for my $testname (@tests)
my $expected;
my $result;
- # Hack to allow TESTDIR=. during parallel tap tests
- my $inputdir = "$ENV{'TESTDIR'}/src/test/modules/libpq_pipeline";
- $inputdir = "$ENV{'TESTDIR'}" if ! -e $inputdir;
+ my $inputdir = "$ENV{'TESTDIR'}/tmp_check";
$expected = slurp_file_eval("$inputdir/traces/$testname.trace");
next unless $expected ne "";
$result = slurp_file_eval($traceout);
diff --git a/src/test/perl/PostgreSQL/Test/Utils.pm b/src/test/perl/PostgreSQL/Test/Utils.pm
index 57fcb240898..5429de41ed5 100644
--- a/src/test/perl/PostgreSQL/Test/Utils.pm
+++ b/src/test/perl/PostgreSQL/Test/Utils.pm
@@ -184,19 +184,21 @@ INIT
# test may still fail, but it's more likely to report useful facts.
$SIG{PIPE} = 'IGNORE';
- # Determine output directories, and create them. The base path is the
- # TESTDIR environment variable, which is normally set by the invoking
- # Makefile.
- $tmp_check = $ENV{TESTDIR} ? "$ENV{TESTDIR}/tmp_check" : "tmp_check";
+ my $test_dir = File::Spec->rel2abs(dirname($0));
+ my $test_name = basename($0);
+ $test_name =~ s/\.[^.]+$//;
+
+ # Determine output directories, and create them.
+ # TODO: set TESTDIR and srcdir?
+ $tmp_check = "$test_dir/tmp_check";
$log_path = "$tmp_check/log";
+ $ENV{TESTDIR} = $test_dir;
mkdir $tmp_check;
mkdir $log_path;
# Open the test log file, whose name depends on the test name.
- $test_logfile = basename($0);
- $test_logfile =~ s/\.[^.]+$//;
- $test_logfile = "$log_path/regress_log_$test_logfile";
+ $test_logfile = "$log_path/regress_log_$test_name";
open my $testlog, '>', $test_logfile
or die "could not open STDOUT to logfile \"$test_logfile\": $!";
diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl
index fdb6f44eded..d7794c5766a 100644
--- a/src/tools/msvc/vcregress.pl
+++ b/src/tools/msvc/vcregress.pl
@@ -261,10 +261,8 @@ sub tap_check
$ENV{PG_REGRESS} = "$topdir/$Config/pg_regress/pg_regress";
$ENV{REGRESS_SHLIB} = "$topdir/src/test/regress/regress.dll";
- $ENV{TESTDIR} = "$dir";
my $module = basename $dir;
- # add the module build dir as the second element in the PATH
- $ENV{PATH} =~ s!;!;$topdir/$Config/$module;!;
+ $ENV{VCREGRESS_MODE} = $Config;
print "============================================================\n";
print "Checking @args\n";
Commits
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
ci: enable zstd where available.
- ff50baec65bb 15.0 landed
-
ci: compile with -Og where applicable.
- 4a288a37f9b7 15.0 landed
-
ci: include hints how to install OS packages.
- 225fb558cd42 15.0 landed
-
ci: fix copy-paste mistake in 16eb8231d1b.
- f79c94f39df0 15.0 landed
-
ci: macos: align sysinfo_script to other tasks.
- 0a156058aa49 15.0 landed
-
ci: Only use one artifact instruction for logs.
- 16eb8231d1b5 15.0 landed
-
ci: s/CCACHE_SIZE/CCACHE_MAXSIZE/.
- 79b79dd57a96 15.0 landed
-
pg_basebackup: Skip a few more fsyncs if --no-sync is specified.
- 9c86d9337eb0 15.0 landed
-
TAP tests: check for postmaster.pid anyway when "pg_ctl start" fails.
- b0623625a0a3 14.2 landed
- 99aa0ff68a2c 11.15 landed
- 6eec809fbcfb 13.6 landed
- 6c4a8903b93f 15.0 landed
- 5940d1b027d7 12.10 landed
- 40756287ff1f 10.20 landed
-
Don't enable fsync in src/test/recovery/t/008_fsm_truncation.pl.
- a7f4171071bb 15.0 landed
-
ci: windows: run initdb with --no-sync.
- dfc0cb3940cd 15.0 landed
-
ci: windows: enable build summary to make it easier to spot warnings / errors.
- 8a1ce5e54f6d 15.0 landed
-
ci: Add continuous integration for github repositories via cirrus-ci.
- 93d973494613 15.0 landed
-
Fix TestLib::slurp_file() with offset on windows.
- 9e3be5c182d7 9.6.24 landed
- d5fa3c086eab 10.19 landed
- 0a134c860fc1 11.14 landed
- cd1b2334b8a2 12.9 landed
- 5ba397f7404e 13.5 landed
- c4465cd09e3a 14.1 landed
- 2f74db1236fe 15.0 landed