Re: Small TAP tests cleanup for Windows and unused modules - Mailing list pgsql-hackers

From Dagfinn Ilmari Mannsåker
Subject Re: Small TAP tests cleanup for Windows and unused modules
Date
Msg-id 87lewyqk45.fsf@wibble.ilmari.org
Whole thread Raw
In response to Re: Small TAP tests cleanup for Windows and unused modules  (Daniel Gustafsson <daniel@yesql.se>)
Responses Re: Small TAP tests cleanup for Windows and unused modules  (Daniel Gustafsson <daniel@yesql.se>)
List pgsql-hackers
Daniel Gustafsson <daniel@yesql.se> writes:

>> On 18 Feb 2022, at 22:02, Daniel Gustafsson <daniel@yesql.se> wrote:
>
>> .. let's drop the 0001 from this thread and just go ahead with 0002.
>
> I applied the 0002 patch today, cleaning up the unused module imports.

A quick git grep¹ revealed a few more extraneous `use Config;`
statements (and manual inspection a few more unused modules in one
file). Here's a patch that removes those. It passes tests using

    ./configure --enable-tap-tests --with-ldap
    make check-world PG_TEST_EXTRA=ldap

- ilmari

[1] git grep -L '[%@$]Config\b' $(git grep -l 'use Config')

From 681897c17c125a0ef380aa3ef0cba786dba24d0b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <ilmari@ilmari.org>
Date: Fri, 25 Mar 2022 12:36:34 +0000
Subject: [PATCH] Remove more unused module imports in test

Commit 7dac61402e34c6d41d5d11cdc4c6a55f91e24026 removed a bunch of
superflous `use Config;` and `use Cwd;` statements, but some were left
behind.
---
 src/bin/pg_ctl/t/001_start_stop.pl | 3 ---
 src/bin/pg_rewind/t/RewindTest.pm  | 1 -
 src/test/ldap/t/001_auth.pl        | 1 -
 3 files changed, 5 deletions(-)

diff --git a/src/bin/pg_ctl/t/001_start_stop.pl b/src/bin/pg_ctl/t/001_start_stop.pl
index 3b45390ced..fdffd76d99 100644
--- a/src/bin/pg_ctl/t/001_start_stop.pl
+++ b/src/bin/pg_ctl/t/001_start_stop.pl
@@ -4,9 +4,6 @@
 use strict;
 use warnings;
 
-use Config;
-use Fcntl ':mode';
-use File::stat qw{lstat};
 use PostgreSQL::Test::Cluster;
 use PostgreSQL::Test::Utils;
 use Test::More;
diff --git a/src/bin/pg_rewind/t/RewindTest.pm b/src/bin/pg_rewind/t/RewindTest.pm
index 5651602858..1e34768e27 100644
--- a/src/bin/pg_rewind/t/RewindTest.pm
+++ b/src/bin/pg_rewind/t/RewindTest.pm
@@ -35,7 +35,6 @@ package RewindTest;
 use warnings;
 
 use Carp;
-use Config;
 use Exporter 'import';
 use File::Copy;
 use File::Path qw(rmtree);
diff --git a/src/test/ldap/t/001_auth.pl b/src/test/ldap/t/001_auth.pl
index 9f15248935..b342146e55 100644
--- a/src/test/ldap/t/001_auth.pl
+++ b/src/test/ldap/t/001_auth.pl
@@ -6,7 +6,6 @@
 use PostgreSQL::Test::Utils;
 use PostgreSQL::Test::Cluster;
 use Test::More;
-use Config;
 
 
 my ($slapd, $ldap_bin_dir, $ldap_schema_dir);
-- 
2.30.2


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: standby recovery fails (tablespace related) (tentative patch and discussion)
Next
From: Japin Li
Date:
Subject: pg_relation_size on partitioned table