All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH 0/3] ptest-pgxs.bbclass: three more fixes
@ 2026-12-06  6:10 Babanpreet Singh
  2026-12-06  6:10 ` [meta-oe][PATCH 1/3] ptest-pgxs.bbclass: accept options written with a space Babanpreet Singh
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Babanpreet Singh @ 2026-12-06  6:10 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Khem Raj, Babanpreet Singh

Three more gaps in ptest-pgxs that came up while running the tests of
more PGXS extensions through it.

Tested on qemux86-64 against PostgreSQL 19.0.

Babanpreet Singh (3):
  ptest-pgxs.bbclass: accept options written with a space
  ptest-pgxs.bbclass: print the diffs from --outputdir
  ptest-pgxs.bbclass: treat an empty exit status as a failure

 meta-oe/classes/ptest-pgxs.bbclass | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [meta-oe][PATCH 1/3] ptest-pgxs.bbclass: accept options written with a space
  2026-12-06  6:10 [meta-oe][PATCH 0/3] ptest-pgxs.bbclass: three more fixes Babanpreet Singh
@ 2026-12-06  6:10 ` Babanpreet Singh
  2026-12-06  6:10 ` [meta-oe][PATCH 2/3] ptest-pgxs.bbclass: print the diffs from --outputdir Babanpreet Singh
  2026-12-06  6:10 ` [meta-oe][PATCH 3/3] ptest-pgxs.bbclass: treat an empty exit status as a failure Babanpreet Singh
  2 siblings, 0 replies; 4+ messages in thread
From: Babanpreet Singh @ 2026-12-06  6:10 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Khem Raj, Babanpreet Singh

Options such as --temp-config were only recognised as "--opt=value".
Written as "--opt value", the server config was not installed and the
tests failed with:

  could not open "./regress.conf" to read extra config: No such file or directory

Signed-off-by: Babanpreet Singh <bbnpreetsingh@gmail.com>
---
 meta-oe/classes/ptest-pgxs.bbclass | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/meta-oe/classes/ptest-pgxs.bbclass b/meta-oe/classes/ptest-pgxs.bbclass
index 4c18ea84f5..173f22fff3 100644
--- a/meta-oe/classes/ptest-pgxs.bbclass
+++ b/meta-oe/classes/ptest-pgxs.bbclass
@@ -35,8 +35,16 @@ EOF
 	schedules=""
 	# REGRESS_OPTS is split on whitespace, so an option whose value
 	# contains spaces or quotes is not supported
+	prev=""
 	for o in $(echo "$vars" | sed -n 's/^REGRESS_OPTS=//p'); do
+		if [ -n "$prev" ]; then
+			o="$prev=$o"
+			prev=""
+		fi
 		case "$o" in
+		--temp-config|--temp-instance|--dbname|--inputdir|--expecteddir|--schedule)
+			prev="$o"
+			;;
 		--temp-config=*) conf=$(basename "${o#--temp-config=}") ;;
 		--temp-instance=*|--dbname=*) ;;
 		--inputdir=*) inputdir="${o#--inputdir=}"; opts="$opts $o" ;;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [meta-oe][PATCH 2/3] ptest-pgxs.bbclass: print the diffs from --outputdir
  2026-12-06  6:10 [meta-oe][PATCH 0/3] ptest-pgxs.bbclass: three more fixes Babanpreet Singh
  2026-12-06  6:10 ` [meta-oe][PATCH 1/3] ptest-pgxs.bbclass: accept options written with a space Babanpreet Singh
@ 2026-12-06  6:10 ` Babanpreet Singh
  2026-12-06  6:10 ` [meta-oe][PATCH 3/3] ptest-pgxs.bbclass: treat an empty exit status as a failure Babanpreet Singh
  2 siblings, 0 replies; 4+ messages in thread
From: Babanpreet Singh @ 2026-12-06  6:10 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Khem Raj, Babanpreet Singh

An extension that sets --outputdir gets its regression diffs written
there, but run-ptest only printed them from the directory the tests ran
in, so failures showed no diffs.

Signed-off-by: Babanpreet Singh <bbnpreetsingh@gmail.com>
---
 meta-oe/classes/ptest-pgxs.bbclass | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/meta-oe/classes/ptest-pgxs.bbclass b/meta-oe/classes/ptest-pgxs.bbclass
index 173f22fff3..70d9b80a87 100644
--- a/meta-oe/classes/ptest-pgxs.bbclass
+++ b/meta-oe/classes/ptest-pgxs.bbclass
@@ -32,6 +32,7 @@ EOF
 	opts=""
 	inputdir=.
 	expecteddir=.
+	outputdir=.
 	schedules=""
 	# REGRESS_OPTS is split on whitespace, so an option whose value
 	# contains spaces or quotes is not supported
@@ -42,13 +43,14 @@ EOF
 			prev=""
 		fi
 		case "$o" in
-		--temp-config|--temp-instance|--dbname|--inputdir|--expecteddir|--schedule)
+		--temp-config|--temp-instance|--dbname|--inputdir|--expecteddir|--outputdir|--schedule)
 			prev="$o"
 			;;
 		--temp-config=*) conf=$(basename "${o#--temp-config=}") ;;
 		--temp-instance=*|--dbname=*) ;;
 		--inputdir=*) inputdir="${o#--inputdir=}"; opts="$opts $o" ;;
 		--expecteddir=*) expecteddir="${o#--expecteddir=}"; opts="$opts $o" ;;
+		--outputdir=*) outputdir="${o#--outputdir=}"; opts="$opts $o" ;;
 		--schedule=*)
 			schedules="$schedules ${o#--schedule=}"
 			opts="$opts --schedule=$(basename "${o#--schedule=}")"
@@ -79,8 +81,8 @@ EOF
 		printf '%b\n' "${PTEST_PGXS_CONF}" >> ${D}${PTEST_PATH}/tests/ptest.conf
 	fi
 
-	printf 'REGRESS="%s"\nREGRESS_OPTS="%s"\nPGBIN="%s"\nPG_REGRESS="%s"\n' \
-		"$regress" "$opts" "${bindir}" \
+	printf 'REGRESS="%s"\nREGRESS_OPTS="%s"\nOUTPUTDIR="%s"\nPGBIN="%s"\nPG_REGRESS="%s"\n' \
+		"$regress" "$opts" "$outputdir" "${bindir}" \
 		"${libdir}/postgresql/pgxs/src/test/regress/pg_regress" \
 		> ${D}${PTEST_PATH}/ptest-pgxs.vars
 
@@ -112,7 +114,7 @@ if [ "$RC" -ne 0 ]; then
         cat "$LOG"
         echo
     fi
-    [ -f "$WORK/regression.diffs" ] && cat "$WORK/regression.diffs"
+    [ -f "$WORK/$OUTPUTDIR/regression.diffs" ] && cat "$WORK/$OUTPUTDIR/regression.diffs"
 fi
 rm -rf "$WORK"
 [ "$RC" -eq 0 ]
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [meta-oe][PATCH 3/3] ptest-pgxs.bbclass: treat an empty exit status as a failure
  2026-12-06  6:10 [meta-oe][PATCH 0/3] ptest-pgxs.bbclass: three more fixes Babanpreet Singh
  2026-12-06  6:10 ` [meta-oe][PATCH 1/3] ptest-pgxs.bbclass: accept options written with a space Babanpreet Singh
  2026-12-06  6:10 ` [meta-oe][PATCH 2/3] ptest-pgxs.bbclass: print the diffs from --outputdir Babanpreet Singh
@ 2026-12-06  6:10 ` Babanpreet Singh
  2 siblings, 0 replies; 4+ messages in thread
From: Babanpreet Singh @ 2026-12-06  6:10 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Khem Raj, Babanpreet Singh

When the tests fill /tmp, the file holding the exit status is left
empty and run-ptest stops with "sh: bad number", without a FAIL line
or the log.

Signed-off-by: Babanpreet Singh <bbnpreetsingh@gmail.com>
---
 meta-oe/classes/ptest-pgxs.bbclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta-oe/classes/ptest-pgxs.bbclass b/meta-oe/classes/ptest-pgxs.bbclass
index 70d9b80a87..a5013111bc 100644
--- a/meta-oe/classes/ptest-pgxs.bbclass
+++ b/meta-oe/classes/ptest-pgxs.bbclass
@@ -106,7 +106,8 @@ LOG="$WORK/pg_regress.log"
     tee "$LOG" |
     sed -n -e 's/^ok [0-9]* *[-+] *\([^ ]*\).*/PASS: \1/p' \
            -e 's/^not ok [0-9]* *[-+] *\([^ ]*\).*/FAIL: \1/p'
-RC=$(cat "$WORK/rc" 2>/dev/null || echo 2)
+RC=$(cat "$WORK/rc" 2>/dev/null)
+[ -n "$RC" ] || RC=2
 
 if [ "$RC" -ne 0 ]; then
     if [ "$RC" -ne 1 ] || ! grep -q '^\(not \)\{0,1\}ok [0-9]' "$LOG"; then
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-12-06  6:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-06  6:10 [meta-oe][PATCH 0/3] ptest-pgxs.bbclass: three more fixes Babanpreet Singh
2026-12-06  6:10 ` [meta-oe][PATCH 1/3] ptest-pgxs.bbclass: accept options written with a space Babanpreet Singh
2026-12-06  6:10 ` [meta-oe][PATCH 2/3] ptest-pgxs.bbclass: print the diffs from --outputdir Babanpreet Singh
2026-12-06  6:10 ` [meta-oe][PATCH 3/3] ptest-pgxs.bbclass: treat an empty exit status as a failure Babanpreet Singh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.