Bug#973393: truncate less of the backtrace during failing ert tests
control: tag -1 + pending Applied, thanks. -- Sean Whitton
Bug#973393: truncate less of the backtrace during failing ert tests
Sean Whitton writes: > Hello, > > On Mon 26 Feb 2024 at 06:16pm -08, Xiyue Deng wrote: > >> Recently when debugging an ERT failure I found that enabling larger >> backtrace margin by default would be very help. > > Hmm, interesting. Can you show an example where it helps, so I can get > an idea of what you have in mind? > Sure! As an example, by default ERT output will truncate at 70, which gives something like: , | Select project: Test test-markdown-ext/wiki-link-rules backtrace: | completing-read-default("Select project: " #f(compiled-function (str | completing-read("Select project: " #f(compiled-function (string pred | project-prompt-project-dir() | project-current(t) | ... ` With the suggested wider margin, this becomes: , | Select project: Test test-markdown-ext/wiki-link-rules backtrace: | completing-read-default("Select project: " #f(compiled-function (string pred action) #) nil t nil nil nil nil) | completing-read("Select project: " #f(compiled-function (string pred action) #) nil t) | project-prompt-project-dir() | project-current(t) | ... ` So that you can see the actual arguments to the calls. (In my patch I took the liberty to set the new margin as 512 (2**9) instead of 500 as suggested in the wiki, for pure personal hygiene.) >> I have tested [1] in my fork to be working. As dh-elpa doesn't enable >> merge requests, I'd like to gather some reviews/comments here before >> merging. TIA! > > I'd be grateful if you'd attach patches to BTS mail in the future, for > inline review. Ah indeed. Attached the patch at EOM as an extra reference. > > Thanks for looking into this. :) -- Xiyue Deng From f9b87fc4857348b327e09513a2286f25b5389f72 Mon Sep 17 00:00:00 2001 From: Xiyue Deng Date: Mon, 26 Feb 2024 17:23:05 -0800 Subject: [PATCH] Use larger margin in backtrace when ERT tests fail (Closes: #973393.) --- debian/changelog | 8 dh_elpa_test | 1 + 2 files changed, 9 insertions(+) diff --git a/debian/changelog b/debian/changelog index 9f30538..ae45ff6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +dh-elpa (2.1.2) UNRELEASED; urgency=medium + + * Team upload. + * Set ert-batch-backtrace-right-margin to 512 to allow meaningful +backtrace info when ERT tests fail (Closes: #973393.) + + -- Xiyue Deng Mon, 26 Feb 2024 17:15:53 -0800 + dh-elpa (2.1.1) experimental; urgency=medium * Remove /usr/share/$flavor/site-lisp/elpa (from emacsen-remove) diff --git a/dh_elpa_test b/dh_elpa_test index c2504bf..847cf80 100755 --- a/dh_elpa_test +++ b/dh_elpa_test @@ -367,6 +367,7 @@ if (@ert_files) { my @args = qw{ emacs -batch -Q -l package }; push @args, ("--eval", "(add-to-list 'package-directory-list \"$dhelpadir\")"); push @args, ("--eval", "(add-to-list 'package-directory-list \"$elpadir\")"); +push @args, ("--eval", "(setq ert-batch-backtrace-right-margin 512)"); push @args, ("-f", "package-initialize"); # add the user's load-path entries -- 2.39.2 signature.asc Description: PGP signature
Bug#973393: truncate less of the backtrace during failing ert tests
Hello, On Mon 26 Feb 2024 at 06:16pm -08, Xiyue Deng wrote: > Recently when debugging an ERT failure I found that enabling larger > backtrace margin by default would be very help. Hmm, interesting. Can you show an example where it helps, so I can get an idea of what you have in mind? > I have tested [1] in my fork to be working. As dh-elpa doesn't enable > merge requests, I'd like to gather some reviews/comments here before > merging. TIA! I'd be grateful if you'd attach patches to BTS mail in the future, for inline review. Thanks for looking into this. -- Sean Whitton signature.asc Description: PGP signature
Bug#973393: truncate less of the backtrace during failing ert tests
Control: tags -1 patch Hi, Recently when debugging an ERT failure I found that enabling larger backtrace margin by default would be very help. I have tested [1] in my fork to be working. As dh-elpa doesn't enable merge requests, I'd like to gather some reviews/comments here before merging. TIA! [1] https://salsa.debian.org/manphiz/dh-elpa/-/compare/master...master?from_project_id=18920 -- Xiyue Deng
Bug#973393: truncate less of the backtrace during failing ert tests
Hello, On Thu 29 Oct 2020 at 03:42PM -04, Nicholas D. Steeves wrote: > Thomas Koch added a nice workaround for truncated backtraces at: > > https://wiki.debian.org/Teams/DebianEmacsenTeam/Tips > > that workaround is d/elpa-test: > > ert_eval = (setq ert-batch-backtrace-right-margin 500) > > and I wonder if it should be activated by default, in the spirit of > Policy §4.9 "The package build should be as verbose as reasonably > possible". Speaking for myself, I would find it helpful, especially > for the rare corner cases where only noninteractive --batch ert tests > will trigger a failure. Also, I've been asked for untruncated > backtraces by various upstreams. > > The only potential issue I can think of is that the reproducible and > DebCI build logs will have then have long lines, but I feel like the > benefit outweighs this consideration. A possible, though not ideal, > solution to this potential issue might be to word-wrap the backtrace, > but that functionality should probably be enabled in upstream Emacs. > > Let's consider setting `ert-batch-backtrace-right-margin` to a large > value in the meantime. I think this is a good idea. Patches welcome. -- Sean Whitton signature.asc Description: PGP signature
Bug#973393: truncate less of the backtrace during failing ert tests
Package: dh-elpa Version: 2.0.4 Severity: normal Hey team, Thomas Koch added a nice workaround for truncated backtraces at: https://wiki.debian.org/Teams/DebianEmacsenTeam/Tips that workaround is d/elpa-test: ert_eval = (setq ert-batch-backtrace-right-margin 500) and I wonder if it should be activated by default, in the spirit of Policy §4.9 "The package build should be as verbose as reasonably possible". Speaking for myself, I would find it helpful, especially for the rare corner cases where only noninteractive --batch ert tests will trigger a failure. Also, I've been asked for untruncated backtraces by various upstreams. The only potential issue I can think of is that the reproducible and DebCI build logs will have then have long lines, but I feel like the benefit outweighs this consideration. A possible, though not ideal, solution to this potential issue might be to word-wrap the backtrace, but that functionality should probably be enabled in upstream Emacs. Let's consider setting `ert-batch-backtrace-right-margin` to a large value in the meantime. Regards, Nicholas