emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] [PATCH] Avoid interaction in test ~ob-tangle/detangle-false-positive~
@ 2023-07-16 12:36 Evgenii Klimov
  2023-07-17  9:00 ` Ihor Radchenko
  0 siblings, 1 reply; 10+ messages in thread
From: Evgenii Klimov @ 2023-07-16 12:36 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 684 bytes --]

Test ~ob-tangle/detangle-false-positive~ asks for confirmation to kill
the buffer, connected to testing/examples/babel.org file, that is
modified during the couse of the test.

Way to reproduce the bug (from projects main dir):

#+BEGIN_SRC sh :dir (expand-file-name ".")
emacs -Q \
      -L lisp/ -L testing/ -L testing/lisp -l lisp/org.el \
      -l lisp/org-id.el -l testing/org-test.el -l testing/lisp/test-ob-tangle.el \
      --eval "(progn (org-reload) (setq org-confirm-babel-evaluate nil) \
      (org-babel-do-load-languages 'org-babel-load-languages \
      '((emacs-lisp . t) (shell . t) (org . t))))" \
      --eval '(ert "ob-tangle/detangle-false-positive")'
#+END_SRC


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-testing-lisp-test-ob-tangle.el-Avoid-interaction-in-.patch --]
[-- Type: text/x-diff, Size: 1054 bytes --]

From 5905e37a581d4cf2a4a517593c91730d836b6471 Mon Sep 17 00:00:00 2001
From: Evgenii Klimov <eugene.dev@lipklim.org>
Date: Sun, 16 Jul 2023 13:14:38 +0100
Subject: [PATCH] testing/lisp/test-ob-tangle.el: Avoid interaction in test

* testing/lisp/test-ob-tangle.el (ob-tangle/detangle-false-positive):
Unset modification flag from buffer to kill
(testing/examples/babel.org) in tear down step of test to avoid Emacs
asking for confirmation during interactive testing from within Emacs.
---
 testing/lisp/test-ob-tangle.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/testing/lisp/test-ob-tangle.el b/testing/lisp/test-ob-tangle.el
index b1b0a0a53..07e75f4d3 100644
--- a/testing/lisp/test-ob-tangle.el
+++ b/testing/lisp/test-ob-tangle.el
@@ -565,6 +565,8 @@ another block
 	    (should (equal (string-trim (org-element-property
 					 :value (org-element-at-point)))
 			   ";; detangle changes"))))
+      (with-current-buffer buffer
+        (set-buffer-modified-p nil))
       (kill-buffer buffer))))
 
 (provide 'test-ob-tangle)
-- 
2.34.1


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

* Re: [BUG] [PATCH] Avoid interaction in test ~ob-tangle/detangle-false-positive~
  2023-07-16 12:36 [BUG] [PATCH] Avoid interaction in test ~ob-tangle/detangle-false-positive~ Evgenii Klimov
@ 2023-07-17  9:00 ` Ihor Radchenko
  2023-07-17 11:53   ` Evgenii Klimov
                     ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Ihor Radchenko @ 2023-07-17  9:00 UTC (permalink / raw)
  To: Evgenii Klimov; +Cc: emacs-orgmode@gnu.org

Evgenii Klimov <eugene.dev@lipklim.org> writes:

> Test ~ob-tangle/detangle-false-positive~ asks for confirmation to kill
> the buffer, connected to testing/examples/babel.org file, that is
> modified during the couse of the test.
>
> Way to reproduce the bug (from projects main dir):

Thanks!
Waiting for your copyright assignment before applying.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: [BUG] [PATCH] Avoid interaction in test ~ob-tangle/detangle-false-positive~
  2023-07-17  9:00 ` Ihor Radchenko
@ 2023-07-17 11:53   ` Evgenii Klimov
  2023-07-17 12:46     ` Ihor Radchenko
  2023-07-20 22:11   ` Evgenii Klimov
  2023-07-21 17:03   ` Ihor Radchenko
  2 siblings, 1 reply; 10+ messages in thread
From: Evgenii Klimov @ 2023-07-17 11:53 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode@gnu.org


Ihor Radchenko <yantar92@posteo.net> writes:

> Evgenii Klimov <eugene.dev@lipklim.org> writes:
>
>> Test ~ob-tangle/detangle-false-positive~ asks for confirmation to kill
>> the buffer, connected to testing/examples/babel.org file, that is
>> modified during the couse of the test.
>>
>> Way to reproduce the bug (from projects main dir):
>
> Thanks!
> Waiting for your copyright assignment before applying.

Thanks, responsible person from FSF just returned from vacation.

While it's not applied, may I also ask: I noticed that non-default value
'other-frame of =org-src-window-setup= variable in my init.el leads to
creation of multiple frames during interactive testing.

I understand that testing should be done on ~emacs -Q~ etc, but since
it's an option to quickly test interactively in the current process
during development, would you accept the patch where
=org-src-window-setup= would be set to default value inside the test?

It took me some time to figure it out, so further developers in the
similar situation could benefit from it.


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

* Re: [BUG] [PATCH] Avoid interaction in test ~ob-tangle/detangle-false-positive~
  2023-07-17 11:53   ` Evgenii Klimov
@ 2023-07-17 12:46     ` Ihor Radchenko
  0 siblings, 0 replies; 10+ messages in thread
From: Ihor Radchenko @ 2023-07-17 12:46 UTC (permalink / raw)
  To: Evgenii Klimov; +Cc: emacs-orgmode@gnu.org

Evgenii Klimov <eugene.dev@lipklim.org> writes:

> While it's not applied, may I also ask: I noticed that non-default value
> 'other-frame of =org-src-window-setup= variable in my init.el leads to
> creation of multiple frames during interactive testing.
>
> I understand that testing should be done on ~emacs -Q~ etc, but since
> it's an option to quickly test interactively in the current process
> during development, would you accept the patch where
> =org-src-window-setup= would be set to default value inside the test?

It is not very meaningful.
Tests generally assume default values.
With user config loaded, tests can (and tend to) break randomly.
Sometimes, spectacularly :)

The only proper way to allow running tests while user config is in place
is force-binding _all_ the Org defaults for the duration of the tests.
And even then, custom advices and re-definition may break things.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: [BUG] [PATCH] Avoid interaction in test ~ob-tangle/detangle-false-positive~
  2023-07-17  9:00 ` Ihor Radchenko
  2023-07-17 11:53   ` Evgenii Klimov
@ 2023-07-20 22:11   ` Evgenii Klimov
  2023-07-21  7:45     ` Ihor Radchenko
  2023-07-21 17:03   ` Ihor Radchenko
  2 siblings, 1 reply; 10+ messages in thread
From: Evgenii Klimov @ 2023-07-20 22:11 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode@gnu.org


Ihor Radchenko <yantar92@posteo.net> writes:

> Evgenii Klimov <eugene.dev@lipklim.org> writes:
>
>> Test ~ob-tangle/detangle-false-positive~ asks for confirmation to kill
>> the buffer, connected to testing/examples/babel.org file, that is
>> modified during the couse of the test.
>>
>> Way to reproduce the bug (from projects main dir):
>
> Thanks!
> Waiting for your copyright assignment before applying.

Copyright assignment is complete.


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

* Re: [BUG] [PATCH] Avoid interaction in test ~ob-tangle/detangle-false-positive~
  2023-07-20 22:11   ` Evgenii Klimov
@ 2023-07-21  7:45     ` Ihor Radchenko
  2023-07-21  9:52       ` Bastien Guerry
  0 siblings, 1 reply; 10+ messages in thread
From: Ihor Radchenko @ 2023-07-21  7:45 UTC (permalink / raw)
  To: Evgenii Klimov, Bastien, Bastien Guerry; +Cc: emacs-orgmode@gnu.org

Evgenii Klimov <eugene.dev@lipklim.org> writes:

>> Waiting for your copyright assignment before applying.
>
> Copyright assignment is complete.

Bastien, may you confirm?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: [BUG] [PATCH] Avoid interaction in test ~ob-tangle/detangle-false-positive~
  2023-07-21  7:45     ` Ihor Radchenko
@ 2023-07-21  9:52       ` Bastien Guerry
  2023-07-21  9:55         ` Ihor Radchenko
  0 siblings, 1 reply; 10+ messages in thread
From: Bastien Guerry @ 2023-07-21  9:52 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Evgenii Klimov, emacs-orgmode@gnu.org

Ihor Radchenko <yantar92@posteo.net> writes:

> Evgenii Klimov <eugene.dev@lipklim.org> writes:
>
>>> Waiting for your copyright assignment before applying.
>>
>> Copyright assignment is complete.
>
> Bastien, may you confirm?

Yes I do!  Thanks for the heads up.

-- 
 Bastien Guerry


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

* Re: [BUG] [PATCH] Avoid interaction in test ~ob-tangle/detangle-false-positive~
  2023-07-21  9:52       ` Bastien Guerry
@ 2023-07-21  9:55         ` Ihor Radchenko
  2023-07-21 13:42           ` Evgenii Klimov
  0 siblings, 1 reply; 10+ messages in thread
From: Ihor Radchenko @ 2023-07-21  9:55 UTC (permalink / raw)
  To: Bastien Guerry; +Cc: Evgenii Klimov, emacs-orgmode@gnu.org

Bastien Guerry <bzg@gnu.org> writes:

>>> Copyright assignment is complete.
>>
>> Bastien, may you confirm?
>
> Yes I do!  Thanks for the heads up.

Thanks!
Recorded.
https://git.sr.ht/~bzg/worg/commit/daaa35a9

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: [BUG] [PATCH] Avoid interaction in test ~ob-tangle/detangle-false-positive~
  2023-07-21  9:55         ` Ihor Radchenko
@ 2023-07-21 13:42           ` Evgenii Klimov
  0 siblings, 0 replies; 10+ messages in thread
From: Evgenii Klimov @ 2023-07-21 13:42 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode@gnu.org


Ihor Radchenko <yantar92@posteo.net> writes:

> Bastien Guerry <bzg@gnu.org> writes:
>
>>>> Copyright assignment is complete.
>>>
>>> Bastien, may you confirm?
>>
>> Yes I do!  Thanks for the heads up.
>
> Thanks!
> Recorded.
> https://git.sr.ht/~bzg/worg/commit/daaa35a9

Thanks, what about the patch itself?


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

* Re: [BUG] [PATCH] Avoid interaction in test ~ob-tangle/detangle-false-positive~
  2023-07-17  9:00 ` Ihor Radchenko
  2023-07-17 11:53   ` Evgenii Klimov
  2023-07-20 22:11   ` Evgenii Klimov
@ 2023-07-21 17:03   ` Ihor Radchenko
  2 siblings, 0 replies; 10+ messages in thread
From: Ihor Radchenko @ 2023-07-21 17:03 UTC (permalink / raw)
  To: Evgenii Klimov; +Cc: emacs-orgmode@gnu.org

Ihor Radchenko <yantar92@posteo.net> writes:

> Evgenii Klimov <eugene.dev@lipklim.org> writes:
>
>> Test ~ob-tangle/detangle-false-positive~ asks for confirmation to kill
>> the buffer, connected to testing/examples/babel.org file, that is
>> modified during the couse of the test.
>>
>> Way to reproduce the bug (from projects main dir):
>
> Thanks!
> Waiting for your copyright assignment before applying.

Applied, onto main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=d6f3aed7b

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

end of thread, other threads:[~2023-07-21 17:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-16 12:36 [BUG] [PATCH] Avoid interaction in test ~ob-tangle/detangle-false-positive~ Evgenii Klimov
2023-07-17  9:00 ` Ihor Radchenko
2023-07-17 11:53   ` Evgenii Klimov
2023-07-17 12:46     ` Ihor Radchenko
2023-07-20 22:11   ` Evgenii Klimov
2023-07-21  7:45     ` Ihor Radchenko
2023-07-21  9:52       ` Bastien Guerry
2023-07-21  9:55         ` Ihor Radchenko
2023-07-21 13:42           ` Evgenii Klimov
2023-07-21 17:03   ` Ihor Radchenko

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).