Re: [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects

2023-01-24 Thread Leo Butler
On Mon, Jan 23 2023, Ihor Radchenko wrote: > Ihor Radchenko writes: > >> Ihor Radchenko writes: >> >>> So, the test failure is real. >> >> The error buffer contents when the test fails is the following: >> >> warning: using the gnuplot graphics toolkit is discouraged >> ... >> [ Babel evaluatio

Re: [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects

2023-01-23 Thread Ihor Radchenko
Ihor Radchenko writes: > Ihor Radchenko writes: > >> So, the test failure is real. > > The error buffer contents when the test fails is the following: > > warning: using the gnuplot graphics toolkit is discouraged > ... > [ Babel evaluation exited with code 0 ] > > Exit code is 0, so octave does

Re: [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects

2023-01-14 Thread Max Nikulin
On 14/01/2023 20:04, Leo Butler wrote: line 0: warning: iconv failed to convert degree sign This warning makes no sense to me. Just a guess. Some code creates a plot with the "°" character, but worker locale is ASCII, not UTF-8 (en_US.UTF-8, C.UTF-8, etc.)

Re: [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects

2023-01-14 Thread Ihor Radchenko
Leo Butler writes: >> The gnuplot graphics toolkit is not actively maintained and has a number >> of limitations that are unlikely to be fixed. Communication with gnuplot >> uses a one-directional pipe and limited information is passed back to the >> Octave interpreter so most changes made inter

Re: [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects

2023-01-14 Thread Leo Butler
On Fri, Jan 13 2023, Ihor Radchenko wrote: > Ihor Radchenko writes: > >> So, the test failure is real. > > The error buffer contents when the test fails is the following: > > warning: using the gnuplot graphics toolkit is discouraged > > The gnuplot graphics toolkit is not actively maintained an

Re: [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects

2023-01-13 Thread Ihor Radchenko
Ihor Radchenko writes: > So, the test failure is real. The error buffer contents when the test fails is the following: warning: using the gnuplot graphics toolkit is discouraged The gnuplot graphics toolkit is not actively maintained and has a number of limitations that are unlikely to be fixe

Re: [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects

2023-01-12 Thread Ihor Radchenko
Leo Butler writes: >> So, the test failure is real. >> >> https://orgmode.org/list/94980226-d29a-4969-8640-1143a1979...@bundesbrandschatzamt.de >> might be related. > > Ihor, > > How do you want to treat the patch that was included? I think we should > have something like that to catch errors lik

Re: [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects

2023-01-11 Thread Leo Butler
On Wed, Jan 11 2023, Ihor Radchenko wrote: > Leo Butler writes: > >> Leo, could you please take a look? > > An earlier test is creating that *Org Babel Error Output* buffer. >>> >>> I will try to look into improving the tests so that we can trap the test(s) >>> that is(are) creating

Re: [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects

2023-01-11 Thread Ihor Radchenko
Leo Butler writes: > Leo, could you please take a look? An earlier test is creating that *Org Babel Error Output* buffer. >> >> I will try to look into improving the tests so that we can trap the test(s) >> that is(are) creating that error buffer. > > See the attachment. There are f

Re: [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects

2023-01-10 Thread Leo Butler
On Sat, Jan 07 2023, Leo Butler wrote: > On Fri, Jan 06 2023, Ihor Radchenko wrote: > >> >> Leo Butler writes: >> https://builds.sr.ht/~bzg/job/914954 2 unexpected results: FAILED ob-octave/graphics-file ((should-not (get-buffer "*Org-Babel Error Output*")) :form (ge

Re: [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects

2023-01-07 Thread Ihor Radchenko
Ihor Radchenko writes: >> See the attached patch. > > Thanks! > Installed onto bugfix. > https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=41ebc2e40 And still not enough... Though this time it does not look like our fault: https://builds.sr.ht/~bzg/job/918602 3 unexpected results:

Re: [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects

2023-01-06 Thread Leo Butler
On Fri, Jan 06 2023, Ihor Radchenko wrote: > > Caution: This message was sent from outside the University of Manitoba. > > > Leo Butler writes: > >>> Apparently, `sleep-for' 1 second

Re: [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects

2023-01-06 Thread Ihor Radchenko
Leo Butler writes: >> Apparently, `sleep-for' 1 second was not enough, and I decided to remove >> checking file size completely. > > Hello Ihor, > > Is there an environment variable that could be used to determine is the > tests are being run on sourcehut? This would let us cut out that test on >

Re: [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects

2023-01-05 Thread Leo Butler
On Mon, Jan 02 2023, Ihor Radchenko wrote: > Ihor Radchenko writes: > >> Ihor Radchenko writes: >> There is a race condition between writing the contents of the graphics file to disk and emacs checking the file size. My guess is that this is causing the problem (and that the same

Re: [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects

2023-01-02 Thread Ihor Radchenko
Ihor Radchenko writes: > Ihor Radchenko writes: > >>> There is a race condition between writing the contents of the graphics >>> file to disk and emacs checking the file size. My guess is that this is >>> causing the problem (and that the same failure applies for emacs-2{6,7}, >>> since only the

Re: [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects

2022-12-29 Thread Ihor Radchenko
Ihor Radchenko writes: >> There is a race condition between writing the contents of the graphics >> file to disk and emacs checking the file size. My guess is that this is >> causing the problem (and that the same failure applies for emacs-2{6,7}, >> since only the emacs-28 reports the exact test

Re: [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects

2022-12-27 Thread Ihor Radchenko
Leo Butler writes: >> Note that the tests are failing only partially. The graphics file does >> get created, but it has 0 size for some reason. Maybe something to do >> with non-graphical CI environment. > > There is a race condition between writing the contents of the graphics > file to disk and

Re: [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects

2022-12-22 Thread Leo Butler
On Wed, Dec 21 2022, Ihor Radchenko wrote: > Ihor Radchenko writes: > >>> Upon confirming the FSF copyright assignment, I have applied the patch >>> onto bugfix. >>> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=01c0ebee2 >> >> Your patch appears to not work in some environment

Re: [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects

2022-12-21 Thread Ihor Radchenko
Ihor Radchenko writes: >> Upon confirming the FSF copyright assignment, I have applied the patch >> onto bugfix. >> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=01c0ebee2 > > Your patch appears to not work in some environments: > > https://builds.sr.ht/~bzg/job/906710 > > Any i

Re: [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects

2022-12-17 Thread Ihor Radchenko
Ihor Radchenko writes: > Leo Butler writes: > >> From 386c9c2f65730459bdc69b2e0b0b76e22e32dbc9 Mon Sep 17 00:00:00 2001 >> From: Leo Butler >> Date: Tue, 8 Nov 2022 13:31:47 -0600 >> Subject: [PATCH] prevent error in Octave process, add tests, update test docs > > Upon confirming the FSF copyri

Re: [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects

2022-12-17 Thread Ihor Radchenko
Leo Butler writes: > From 386c9c2f65730459bdc69b2e0b0b76e22e32dbc9 Mon Sep 17 00:00:00 2001 > From: Leo Butler > Date: Tue, 8 Nov 2022 13:31:47 -0600 > Subject: [PATCH] prevent error in Octave process, add tests, update test docs Upon confirming the FSF copyright assignment, I have applied the

Re: [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects

2022-11-15 Thread Leo Butler
On Mon, Nov 14 2022, Ihor Radchenko wrote: > Leo Butler writes: > >> The amended patch is attached. Thanks for your helpful feedback. > > Thanks for the patch! > It looks good, and the tests are passing. However, there is a side effect > leaving testing/examples/octave-workspace file after runni

Re: [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects

2022-11-14 Thread Ihor Radchenko
Leo Butler writes: > The amended patch is attached. Thanks for your helpful feedback. Thanks for the patch! It looks good, and the tests are passing. However, there is a side effect leaving testing/examples/octave-workspace file after running the tests. Can something be done about this? -- Ih

Re: [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects

2022-11-09 Thread Leo Butler
Ihor, see below. On Wed, Nov 09 2022, Ihor Radchenko wrote: > Leo Butler writes: > >> Ihor, >> Thanks for your feeback and the pointer. I have revised the tests and >> attach the revised patch. > > Thanks! > > Note that your patch is over 15LOC, which exceeds legally allowed > contribution size

Re: [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects

2022-11-08 Thread Ihor Radchenko
Leo Butler writes: > Ihor, > Thanks for your feeback and the pointer. I have revised the tests and > attach the revised patch. Thanks! Note that your patch is over 15LOC, which exceeds legally allowed contribution size for people without copyright assignment. Would you be interested to sign th

[PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects

2022-11-08 Thread Leo Butler
On Tue, Nov 08 2022, Ihor Radchenko wrote: > Leo Butler writes: > >> However, I would like feedback/suggestions on writing such a >> test. Issues include: >> >> 1. how to clean up the side-effects, including changes in the test >>buffer, filesystem and potentially creating an error buffer; >

Re: [PATCH] rfc: using ert-deftest with side-effects

2022-11-07 Thread Ihor Radchenko
Leo Butler writes: > However, I would like feedback/suggestions on writing such a > test. Issues include: > > 1. how to clean up the side-effects, including changes in the test >buffer, filesystem and potentially creating an error buffer; As you did, we generally use unwind-protect. Also, we

[PATCH] rfc: using ert-deftest with side-effects

2022-11-07 Thread Leo Butler
Hello, I am patching a bug in ob-octave.el (see attachment) involving the creation of graphics files. The bug itself is easy to fix: a single line in ob-octave.el ensures the special variable `ans' is bound, to prevent Octave from exiting with a non-zero exit code. However, I would like feedback/