v2-0002-test-perl-clean-up-when-PG_TEST_NOCLEAN-0.patch
text/x-patch
Filename: v2-0002-test-perl-clean-up-when-PG_TEST_NOCLEAN-0.patch
Type: text/x-patch
Part: 1
Patch
Format: format-patch
Series: patch v2-0002
Subject: test/perl: clean up when PG_TEST_NOCLEAN=0
| File | + | − |
|---|---|---|
| src/test/perl/PostgreSQL/Test/Cluster.pm | 1 | 1 |
| src/test/perl/PostgreSQL/Test/Utils.pm | 2 | 3 |
From 42299731884b939a90495d04fe3e8411d0a2a97d Mon Sep 17 00:00:00 2001
From: Jacob Champion <jchampion@timescale.com>
Date: Tue, 27 Jun 2023 08:43:19 -0700
Subject: [PATCH v2 2/2] test/perl: clean up when PG_TEST_NOCLEAN=0
Prior to this patch, setting PG_TEST_NOCLEAN=0 (or PG_TEST_NOCLEAN=)
still would have skipped the cleanup step.
---
src/test/perl/PostgreSQL/Test/Cluster.pm | 2 +-
src/test/perl/PostgreSQL/Test/Utils.pm | 5 ++---
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/test/perl/PostgreSQL/Test/Cluster.pm b/src/test/perl/PostgreSQL/Test/Cluster.pm
index 5e161dbee6..f48e935437 100644
--- a/src/test/perl/PostgreSQL/Test/Cluster.pm
+++ b/src/test/perl/PostgreSQL/Test/Cluster.pm
@@ -1637,7 +1637,7 @@ END
$node->teardown_node(fail_ok => 1);
# skip clean if we are requested to retain the basedir
- next if defined $ENV{'PG_TEST_NOCLEAN'};
+ next if $ENV{PG_TEST_NOCLEAN};
# clean basedir on clean test invocation
$node->clean_node
diff --git a/src/test/perl/PostgreSQL/Test/Utils.pm b/src/test/perl/PostgreSQL/Test/Utils.pm
index e5a08d7b1a..a9aecf5aa9 100644
--- a/src/test/perl/PostgreSQL/Test/Utils.pm
+++ b/src/test/perl/PostgreSQL/Test/Utils.pm
@@ -286,7 +286,7 @@ sub tempdir
return File::Temp::tempdir(
$prefix . '_XXXX',
DIR => $tmp_check,
- CLEANUP => not defined $ENV{'PG_TEST_NOCLEAN'});
+ CLEANUP => not $ENV{PG_TEST_NOCLEAN});
}
=pod
@@ -300,8 +300,7 @@ name, to avoid path length issues.
sub tempdir_short
{
-
- return File::Temp::tempdir(CLEANUP => not defined $ENV{'PG_TEST_NOCLEAN'});
+ return File::Temp::tempdir(CLEANUP => not $ENV{PG_TEST_NOCLEAN});
}
=pod
--
2.25.1