Re: bug#48598: 28.0.50; buffer-naming collisions involving bouncers in ERC

"J.P." <[email protected]>
Newsgroups gmane.emacs.erc.general
Message-ID <[email protected]>
Hi Michael,

Michael Albinus <[email protected]> writes:

> The test targets for EMBA are generated. If there is a subdirectory
> test/lisp/erc/erc-d, a respective target will appear.
>
> The test-all-inotify job covers all tests, also the tests in subsubdirectories.
>
> Best regards, Michael.

Thanks for patiently explaining yet again. I really should've been more
mindful of your time and studied up a bit before reaching out. But if
you'll allow me more excuses, part of what threw me about the
subdir-discovery situation was that the "normal" stage of the initial
(new branch) pipeline of fix/bug-48598 didn't include a job named
test-lisp-erc-erc-d-inotify [1].

And not that this matters in the slightest, but in an ideal world, *all*
of ERC's stable tests would *always* run (including the expensive ones),
both for jobs in diff-based, push pipelines (test-lisp-erc*-inotify) and
those in the thrice-daily, scheduled ones (test-all-inotify). Also ideal
would be having those tests that live in subdirs of test/lisp/erc (such
as test/lisp/erc/erc-d) run as part of the "main" job
(test-lisp-erc-inotify) rather than only when some change touches their
little area.

FWIW, I've attached some shoddy infra-related patches, mainly as a means
of better illustrating the aforementioned pie-in-the-sky behavior [2].
Regardless, I realize that giving ERC special treatment is likely not in
the cards. As such, I'm planning on rigging up our own CI setup for
testing proposed changes that hit the bug tracker (especially against
older Emacs versions) [3]. When the time comes, any guidance you might
spare will be greatly appreciated.

Thanks,
J.P.

P.S. I'll try and refrain from bothering you again in the (immediate)
future.


[1] https://emba.gnu.org/emacs/emacs/-/pipelines/16954

    I suppose that's because it was based on a preexisting
    test/infra/test-jobs.yml (?).

[2] That said, a flimsy rationale for the first one might be that it
    makes it slightly easier on external tooling trying to leverage
    existing in-tree recipes (but that's probably a stretch). Right now,
    I'm doing stuff like

    make -C test SELECTOR="(...)" check-lisp-foo

    everywhere. Not a major hassle, but it'd be nice to skip the
    SELECTOR part, especially when invoking Make by hand. (Just a
    thought.)

[3] If anyone out there cares, it'll also deploy ERC packages built from
    open bug sets to our own little ELPA to make it easier on everyday
    folks wanting to give feedback on proposed changes. Actually, we've
    already been doing all of this for over a year, only this time
    around, the idea is to make it less amateurish and have it run on
    Savannah or somewhere other than big cloud infra.
0001-POC-CHECK-Add-check-expensive-prefixes-for-test-subd.patch (text/x-patch, 1.1 KB)
From 750af6c4b42f2d4b2304cb3e693f266bb2bb62c8 Mon Sep 17 00:00:00 2001
From: "F. Jason Park" <[email protected]>
Date: Wed, 13 Apr 2022 21:03:36 -0700
Subject: [PATCH 1/2] [POC CHECK] Add check-expensive- prefixes for test-subdir
 targets

* test/Makefile.in (subdir_template): Convert all targets like
'check-{lisp,src}-mylib' to multi-targets (info "(make) Multiple
Targets") that also match 'check-expensive-{lisp,src}-mylib' variants.
---
 test/Makefile.in | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/test/Makefile.in b/test/Makefile.in
index 3b6e116e65..445101f430 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -245,9 +245,10 @@ SUBDIR_TARGETS =
 
 define subdir_template
   SUBDIR_TARGETS += check-$(subst /,-,$(1))
-  .PHONY: check-$(subst /,-,$(1))
-  check-$(subst /,-,$(1)):
-	@${MAKE} check LOGFILES="$(patsubst %.el,%.log, \
+  .PHONY: check-$(subst /,-,$(1)) check-expensive-$(subst /,-,$(1))
+  check-$(subst /,-,$(1)) check-expensive-$(subst /,-,$(1)):
+	@${MAKE} $$(subst -$(subst /,-,$(1)),,$$@) \
+		LOGFILES="$(patsubst %.el,%.log, \
 		$(patsubst $(srcdir)/%,%,$(wildcard ${srcdir}/$(1)/*.el)))"
 endef
 
-- 
2.35.1
0002-POC-CHECK-Allow-check-expensive-target-for-generated.patch (text/x-patch, 993 B)
From c0183f22c92507b860866facbc4815bc4a4a98f7 Mon Sep 17 00:00:00 2001
From: "F. Jason Park" <[email protected]>
Date: Wed, 13 Apr 2022 22:43:10 -0700
Subject: [PATCH 2/2] [POC CHECK] Allow check-expensive target for generated
 test jobs

* test/infra/Makefile.in: Always run expensive tests for generated ERC
jobs.
---
 test/infra/Makefile.in | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/test/infra/Makefile.in b/test/infra/Makefile.in
index c251578e6a..0d44d96b4c 100644
--- a/test/infra/Makefile.in
+++ b/test/infra/Makefile.in
@@ -35,9 +35,14 @@ SUBDIR_TARGETS =
 FILE = test-jobs.yml
 tn = $$$${test_name}
 cps = $$$$CI_PIPELINE_SOURCE
+ALWAYS_EXPENSIVE = lisp/erc
 
 define subdir_template
-  $(eval target = check-$(subst /,-,$(1)))
+  $(eval
+  target = check-$(subst /,-,$(1))
+  ifneq ($(foreach d, $(ALWAYS_EXPENSIVE), $(findstring $(d),$(1))),)
+	target = check-expensive-$(subst /,-,$(1))
+  endif)
   SUBDIR_TARGETS += $(target)
 
   $(eval
-- 
2.35.1
0001-POC-GROUP-Allow-shared-triggering-of-subdir-tests.patch (text/x-patch, 2.4 KB)
From f2b8c5f2f8ef4efe5dc3c05139308e1e83a98788 Mon Sep 17 00:00:00 2001
From: "F. Jason Park" <[email protected]>
Date: Thu, 14 Apr 2022 20:39:24 -0700
Subject: [PATCH] [POC GROUP] Allow shared triggering of subdir tests

* test/infra/Makefile.in: For certain libraries, collect subdirs and
defer rendering of generated YAML until after initial run.
---
 test/infra/Makefile.in | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/test/infra/Makefile.in b/test/infra/Makefile.in
index c251578e6a..e4a6dafce9 100644
--- a/test/infra/Makefile.in
+++ b/test/infra/Makefile.in
@@ -35,10 +35,23 @@ SUBDIR_TARGETS =
 FILE = test-jobs.yml
 tn = $$$${test_name}
 cps = $$$$CI_PIPELINE_SOURCE
+# Library groups for which changes trigger all tests in the hierarchy
+GROUPED = lisp/erc
 
 define subdir_template
   $(eval target = check-$(subst /,-,$(1)))
-  SUBDIR_TARGETS += $(target)
+  $(eval found_deferred = $(foreach d, $(GROUPED), $(findstring $(d), $(1))))
+  $(eval
+    deferring =
+    ifneq ($(SUBDIRS_DEFERRED),)
+    target = $(foreach d, $(defer_$(subst /,-,$(1))),check-$(subst /,-,$(d)))
+    SUBDIR_TARGETS += $(target)
+    else ifneq ($(found_deferred),)
+    defer_$(subst /,-,$(firstword $(found_deferred))) += $(1)
+    deferring = 1
+    else
+    SUBDIR_TARGETS += $(target)
+    endif)
 
   $(eval
     ifeq ($(findstring src, $(1)), src)
@@ -61,12 +74,23 @@ define subdir_template
     define changes
 	@echo '        - admin/*.el' >>$(FILE)
     endef
+    else ifneq ($(SUBDIRS_DEFERRED),)
+    define changes
+	@printf '%s\n' \
+	$(foreach d, $(defer_$(subst /,-,$(1))), \
+	'        - $(d)/*.el' \
+	$(and $(subst $(1),,$(d)), \
+	'        - test/$(d)/*.el' \
+	'        - test/$(d)/*resources/**' \
+	)) >>$(FILE)
+    endef
     else
     define changes
 	@echo '        - $(1)/*.el' >>$(FILE)
     endef
     endif)
 
+  ifeq ($(deferring),)
   $(target):
 	@echo >>$(FILE)
 	@echo 'test-$(subst /,-,$(1))-inotify:' >>$(FILE)
@@ -85,9 +109,12 @@ define subdir_template
 	@echo '  variables:' >>$(FILE)
 	@echo '    target: emacs-inotify' >>$(FILE)
 	@echo '    make_params: "-k -C test $(target)"' >>$(FILE)
+  endif
 endef
 
 $(foreach subdir, $(SUBDIRS), $(eval $(call subdir_template,$(subdir))))
+SUBDIRS_DEFERRED = $(filter $(GROUPED),$(SUBDIRS))
+$(foreach subdir, $(SUBDIRS_DEFERRED), $(eval $(call subdir_template,$(subdir))))
 
 all: generate-test-jobs
 
-- 
2.35.1
test-jobs-check.diff (text/x-patch, 730 B)
diff --git a/test-jobs-orig.yml b/test-jobs-check-expensive.yml
index b10f6a9df7..76043d8bf4 100644
--- a/test-jobs-orig.yml
+++ b/test-jobs-check-expensive.yml
@@ -219,7 +219,7 @@ test-lisp-erc-inotify:
         - test/lisp/erc/*resources/**
   variables:
     target: emacs-inotify
-    make_params: "-k -C test check-lisp-erc"
+    make_params: "-k -C test check-expensive-lisp-erc"
 
 test-lisp-erc-erc-d-inotify:
   stage: normal
@@ -236,7 +236,7 @@ test-lisp-erc-erc-d-inotify:
         - test/lisp/erc/erc-d/*resources/**
   variables:
     target: emacs-inotify
-    make_params: "-k -C test check-lisp-erc-erc-d"
+    make_params: "-k -C test check-expensive-lisp-erc-erc-d"
 
 test-lisp-eshell-inotify:
   stage: normal
test-jobs-check-want.yml (application/octet-stream, 13.8 KB) - not displayed
test-jobs-group.diff (text/x-patch, 1.9 KB)
diff --git a/test-jobs-orig.yml b/test-jobs-want.yml
index b10f6a9df7..347d907a50 100644
--- a/test-jobs-orig.yml
+++ b/test-jobs-want.yml
@@ -204,40 +204,6 @@ test-lisp-emulation-inotify:
     target: emacs-inotify
     make_params: "-k -C test check-lisp-emulation"
 
-test-lisp-erc-inotify:
-  stage: normal
-  extends: [.job-template, .test-template]
-  needs:
-    - job: build-image-inotify
-      optional: true
-  rules:
-    - if: '$CI_PIPELINE_SOURCE == "schedule"'
-      when: never
-    - changes:
-        - lisp/erc/*.el
-        - test/lisp/erc/*.el
-        - test/lisp/erc/*resources/**
-  variables:
-    target: emacs-inotify
-    make_params: "-k -C test check-lisp-erc"
-
-test-lisp-erc-erc-d-inotify:
-  stage: normal
-  extends: [.job-template, .test-template]
-  needs:
-    - job: build-image-inotify
-      optional: true
-  rules:
-    - if: '$CI_PIPELINE_SOURCE == "schedule"'
-      when: never
-    - changes:
-        - lisp/erc/erc-d/*.el
-        - test/lisp/erc/erc-d/*.el
-        - test/lisp/erc/erc-d/*resources/**
-  variables:
-    target: emacs-inotify
-    make_params: "-k -C test check-lisp-erc-erc-d"
-
 test-lisp-eshell-inotify:
   stage: normal
   extends: [.job-template, .test-template]
@@ -560,3 +526,23 @@ test-src-inotify:
   variables:
     target: emacs-inotify
     make_params: "-k -C test check-src"
+
+test-lisp-erc-inotify:
+  stage: normal
+  extends: [.job-template, .test-template]
+  needs:
+    - job: build-image-inotify
+      optional: true
+  rules:
+    - if: '$CI_PIPELINE_SOURCE == "schedule"'
+      when: never
+    - changes:
+        - lisp/erc/*.el
+        - lisp/erc/erc-d/*.el
+        - test/lisp/erc/erc-d/*.el
+        - test/lisp/erc/erc-d/*resources/**
+        - test/lisp/erc/*.el
+        - test/lisp/erc/*resources/**
+  variables:
+    target: emacs-inotify
+    make_params: "-k -C test check-lisp-erc check-lisp-erc-erc-d"
test-jobs-group-want.yml (application/octet-stream, 13.5 KB) - not displayed
test-jobs-orig.yml (application/octet-stream, 13.8 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.