expected test failures?

Mads Kiilerich mads at kiilerich.com
Fri Nov 20 19:25:42 CST 2009


Benoit Boissinot wrote, On 11/20/2009 08:06 PM:
> On Fri, Nov 20, 2009 at 01:56:11PM -0500, Neal Becker wrote:
>> On Friday 20 November 2009, Benoit Boissinot wrote:
>>> On Fri, Nov 20, 2009 at 11:52:37AM -0500, Neal Becker wrote:
>>>> On Friday 20 November 2009, Benoit Boissinot wrote:
>>>>> On Fri, Nov 20, 2009 at 5:01 PM, Neal Becker<ndbecker2 at gmail.com>
>> wrote:
>>>>>> http://fpaste.org/O9WL/
>>>>>
>>>>> Does echo $COLUMN return something?
>>>>>
>>>>> thanks,
>>>>>
>>>>> Benoit
>>>>
>>>> No.  Tests fail when run under emacs shell.  Tests passed when run under
>>>> konsole.  Neither has $COLUMN set.  This is rediculous!
>>>
>>> does the following fixes it?
>>>
>>> diff --git a/tests/run-tests.py b/tests/run-tests.py
>>> --- a/tests/run-tests.py
>>> +++ b/tests/run-tests.py
>>> @@ -785,6 +785,7 @@
>>>       os.environ['TZ'] = 'GMT'
>>>       os.environ["EMAIL"] = "Foo Bar<foo.bar at example.com>"
>>>       os.environ['CDPATH'] = ''
>>> +    os.environ['COLUMN'] = '80'
>>>
>>>       global TESTDIR, HGTMP, INST, BINDIR, PYTHONDIR, COVERAGE_FILE
>>>       TESTDIR = os.environ["TESTDIR"] = os.getcwd()
>>>
>>
>> Yes (COLUMNS) fixes it.

Let me say explicitly what might be common knowledge: "Ordinary" 
interactive shells apparently do have COLUMNS set but not exported. 
Emacs shells apparently also has COLUMNS exported, and COLUMNS is thus 
inherited to subprocesses such as the Mercurial tests.

>> Does it have to be so fragile?
>
> It's not fragile,

Come on, Benoit; the tests _are_ definitely more fragile than necessary. 
It is fragile, but it doesn't have to be fragile. Benoit, your (fixed) 
patch is a good solution and should be applied to stable.

At the same time I must say that I do find Neals sarcastic wording 
unnecessarily offensive.

 > we just need to have fixed settings when testing the
> output (like using LANG=C). But it's good that it adapts to the terminal
> width.

Absolutely. That is a good argument why COLUMNS should be set in 
run-tests.py, to "Reset some environment variables to well-known values 
so that the tests produce repeatable output."

(The explicit COLUMNS=80 should probably also be removed from test-churn 
and test-patchbomb? And perhaps TERM should be cleaned up in a similar way?)

/Mads


More information about the Mercurial-devel mailing list