clean up test_rls_hooks module
Over at [1]/messages/by-id/47F87A0E-C0E5-43A6-89F6-D403F2B45175@enterprisedb.com Mark Dilger got led astray because he used
src/test/modules/test_rls_hooks as a template for his new test module.
It looks like that module was created with some over eager copying of
another test module, but it has a couple of things wrong with it.
. it isn't an extension, so the Makefile shouldn't have an EXTENSION
entry, and there shouldn't be a .control file
. it doesn't need to be preloaded so there is no requirement for a
special config, nor for corresponding REGRESS_OPTS and NO_INSTALLCHECK
lines in the Makefile.
Here's a patch to fix those things.
cheers
andrew
[1]: /messages/by-id/47F87A0E-C0E5-43A6-89F6-D403F2B45175@enterprisedb.com
/messages/by-id/47F87A0E-C0E5-43A6-89F6-D403F2B45175@enterprisedb.com
--
Andrew Dunstan
EDB: https://www.enterprisedb.com
Attachments:
0001-fix-test_rls_hooks.patchtext/x-patch; charset=UTF-8; name=0001-fix-test_rls_hooks.patchDownload
From 21f316d29881c3294f8d0b1bc2f0dde8eec38c2d Mon Sep 17 00:00:00 2001
From: Andrew Dunstan <andrew@dunslane.net>
Date: Wed, 23 Mar 2022 08:49:07 -0400
Subject: [PATCH] fix test_rls_hooks
---
src/test/modules/test_rls_hooks/Makefile | 12 ++----------
src/test/modules/test_rls_hooks/rls_hooks.conf | 1 -
.../modules/test_rls_hooks/test_rls_hooks.control | 4 ----
3 files changed, 2 insertions(+), 15 deletions(-)
delete mode 100644 src/test/modules/test_rls_hooks/rls_hooks.conf
delete mode 100644 src/test/modules/test_rls_hooks/test_rls_hooks.control
diff --git a/src/test/modules/test_rls_hooks/Makefile b/src/test/modules/test_rls_hooks/Makefile
index a4f7d855c0..519eb9513d 100644
--- a/src/test/modules/test_rls_hooks/Makefile
+++ b/src/test/modules/test_rls_hooks/Makefile
@@ -1,19 +1,11 @@
# src/test/modules/test_rls_hooks/Makefile
MODULE_big = test_rls_hooks
-OBJS = \
- $(WIN32RES) \
- test_rls_hooks.o
-PGFILEDESC = "test_rls_hooks - example use of RLS hooks"
+OBJS = test_rls_hooks.o $(WIN32RES)
-EXTENSION = test_rls_hooks
-# DATA = test_rls_hooks--1.0.sql
+PGFILEDESC = "test_rls_hooks - example use of RLS hooks"
REGRESS = test_rls_hooks
-REGRESS_OPTS = --temp-config=$(top_srcdir)/src/test/modules/test_rls_hooks/rls_hooks.conf
-# Disabled because these tests require "shared_preload_libraries=test_rls_hooks",
-# which typical installcheck users do not have (e.g. buildfarm clients).
-NO_INSTALLCHECK = 1
ifdef USE_PGXS
PG_CONFIG = pg_config
diff --git a/src/test/modules/test_rls_hooks/rls_hooks.conf b/src/test/modules/test_rls_hooks/rls_hooks.conf
deleted file mode 100644
index a522c0e550..0000000000
--- a/src/test/modules/test_rls_hooks/rls_hooks.conf
+++ /dev/null
@@ -1 +0,0 @@
-shared_preload_libraries = test_rls_hooks
diff --git a/src/test/modules/test_rls_hooks/test_rls_hooks.control b/src/test/modules/test_rls_hooks/test_rls_hooks.control
deleted file mode 100644
index 9f9f13f76c..0000000000
--- a/src/test/modules/test_rls_hooks/test_rls_hooks.control
+++ /dev/null
@@ -1,4 +0,0 @@
-comment = 'Test code for RLS hooks'
-default_version = '1.0'
-module_pathname = '$libdir/test_rls_hooks'
-relocatable = true
--
2.25.1
Andrew Dunstan <andrew@dunslane.net> writes:
Here's a patch to fix those things.
Seems reasonable to me, except that I think I'd leave the formatting
of the OBJS macro alone. IIRC, Andres or someone went around and
made all of those follow this one-file-per-line style some time ago.
regards, tom lane
Hi,
On 2022-03-23 10:07:06 -0400, Tom Lane wrote:
Andrew Dunstan <andrew@dunslane.net> writes:
Here's a patch to fix those things.
Seems reasonable to me, except that I think I'd leave the formatting
of the OBJS macro alone. IIRC, Andres or someone went around and
made all of those follow this one-file-per-line style some time ago.
Yea. merge conflicts are considerably rarer that way, and a heck of a lot
easier to deal with when they occur.
Greetings,
Andres Freund