test_msgeditor.MsgEditorTest.test__run_editor_EACCES breaks noninteractive test suite

Bug #347130 reported by Bob Tanner
10
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Low
Vincent Ladeuil

Bug Description

NOTE: this is for 1.13.1 (I can test on 1.14 if it's useful(

./bzrlib/tests/test_msgeditor.py:test__run_editor_EACCES() breaks the noninteractive test suite. Issue might be related to editor selection/fallback bug (Bug #326291)

Example runs:

$ unset EDITOR
$ unset VISUAL
$ ./bzr selftest MsgEditorTest
<snip>
Ran 20 tests in 0.886s
OK
tests passed
=========================
$ export EDITOR=vim
$ ./bzr selftest MsgEditorTest
<snip>
Ran 20 tests in 0.886s
OK
tests passed
=========================
$ unset EDITOR
$ export VISUAL=vim
$ ./bzr selftest MsgEditorTest
<snip>
<vim invoked>
" ============================================================================
" Netrw Directory Listing (netrw v125)
" /tmp/testbzr-ogwckG.tmp/bzrlib.tests.test_msgeditor.MsgEditorTest.test__run_
" Sorted by name
" Sort sequence: [\/]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$,\.swp$,\.bak$,\~
" Quick Help: <F1>:help -:go up dir D:delete R:rename s:sort-by x:exec
" ============================================================================
../
eacces.py
fed.sh*
<:q to exit vim>
Ran 20 tests in 23.118s
OK
tests passed
=========================
$ export VISUAL=false
$ ./bzr selftest MsgEditorTe
testing: /tmp/prepare-1.13.1/bzr
   /tmp/prepare-1.13.1/bzrlib (1.13.1 python2.5.2)

ERROR: test_msgeditor.MsgEditorTest.test__run_editor_EACCES
    Could not start any editor.
Please specify one with:
 - $BZR_EDITOR
 - editor=/some/path in /tmp/testbzr-3m-Q3M.tmp/bzrlib.tests.test_msgeditor.MsgEditorTest.test__run_editor_EACCES/home/.bazaar/bazaar.conf
 - $VISUAL
 - $EDITOR

Related branches

Revision history for this message
Vincent Ladeuil (vila) wrote :

Sounds like test__run_editor_EACCES is not correctly isolated.

Changed in bzr:
assignee: nobody → vila
status: New → Confirmed
Revision history for this message
Andrew Bennetts (spiv) wrote :

Looking at the code, this is almost certainly bug 326291 as the original description suggests.

The test is meant to:

 * set the first possible editor to something that triggers EACCESS (because that's the condition we want to test)
 * set the second possible editor to a script that non-interactively succeeds, to isolate the test from the other fallbacks (although ideally bzrlib.tests.TestCase.setUp would also provide this isolation).

But by setting $EDITOR rather than $VISUAL in the second part, it fails to properly isolate the test.

Vincent Ladeuil (vila)
Changed in bzr:
importance: Undecided → Low
milestone: none → 1.14rc1
status: Confirmed → Fix Committed
Vincent Ladeuil (vila)
Changed in bzr:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.