[PATCH] test: remove dependency on $PYTHONDIR

Durham Goode durham at fb.com
Wed Feb 17 19:39:01 EST 2016


Our path is derived from the PYTHONPATH we're setting.  We could set 
another environment variable to inform the test runner of what the 
PYTHONDIR should be, but I feel like the tests shouldn't be making 
assumptions about where the tests are running (and don't really need to).

I'm not sure what you're asking with "Does this apply everywhere that 
you might do this?"  Does what apply where?

On 2/17/16 4:24 PM, timeless wrote:
> So, I intentionally added PYTHONDIR to try to reduce the number of
> globs floating around.
>
> Does this apply to everywhere that you might do this?
>
> I have some plans to try to improve the diff munging, but basically
> each time something changes and there's a glob, the user is forced to
> deal w/ it.
>
> I'd really rather some other approach than what you're doing here...
>
> Could we introduce a different variable/allow run-tests to know about yours?
>
> On Wed, Feb 17, 2016 at 6:18 PM, Durham Goode <durham at fb.com> wrote:
>> # HG changeset patch
>> # User Durham Goode <durham at fb.com>
>> # Date 1455750820 28800
>> #      Wed Feb 17 15:13:40 2016 -0800
>> # Node ID 5cef3483a31ecd1f18083fc8da3a7fbcd4a22b5b
>> # Parent  4f99a5826e88fa6b4305336556cc939ca2cdaff1
>> test: remove dependency on $PYTHONDIR
>>
>> The PYTHONDIR used in the test may not match the one set in the environment, so
>> let's remove this depdency and replace it with a glob.
>>
>> Our internal test automation caught this, since we muck with the PYTHONPATH to
>> allow testing many of our non-installed extensions together.
>>
>> diff --git a/tests/test-devel-warnings.t b/tests/test-devel-warnings.t
>> --- a/tests/test-devel-warnings.t
>> +++ b/tests/test-devel-warnings.t
>> @@ -83,27 +83,27 @@
>>     $ hg buggylocking --traceback
>>     devel-warn: transaction with no lock at:
>>      */hg:* in * (glob)
>> -   $PYTHONDIR/mercurial/dispatch.py:* in run (glob)
>> -   $PYTHONDIR/mercurial/dispatch.py:* in dispatch (glob)
>> -   $PYTHONDIR/mercurial/dispatch.py:* in _runcatch (glob)
>> -   $PYTHONDIR/mercurial/dispatch.py:* in _dispatch (glob)
>> -   $PYTHONDIR/mercurial/dispatch.py:* in runcommand (glob)
>> -   $PYTHONDIR/mercurial/dispatch.py:* in _runcommand (glob)
>> -   $PYTHONDIR/mercurial/dispatch.py:* in checkargs (glob)
>> -   $PYTHONDIR/mercurial/dispatch.py:* in <lambda> (glob)
>> -   $PYTHONDIR/mercurial/util.py:* in check (glob)
>> +   */mercurial/dispatch.py:* in run (glob)
>> +   */mercurial/dispatch.py:* in dispatch (glob)
>> +   */mercurial/dispatch.py:* in _runcatch (glob)
>> +   */mercurial/dispatch.py:* in _dispatch (glob)
>> +   */mercurial/dispatch.py:* in runcommand (glob)
>> +   */mercurial/dispatch.py:* in _runcommand (glob)
>> +   */mercurial/dispatch.py:* in checkargs (glob)
>> +   */mercurial/dispatch.py:* in <lambda> (glob)
>> +   */mercurial/util.py:* in check (glob)
>>      $TESTTMP/buggylocking.py:* in buggylocking (glob)
>>     devel-warn: "wlock" acquired after "lock" at:
>>      */hg:* in * (glob)
>> -   $PYTHONDIR/mercurial/dispatch.py:* in run (glob)
>> -   $PYTHONDIR/mercurial/dispatch.py:* in dispatch (glob)
>> -   $PYTHONDIR/mercurial/dispatch.py:* in _runcatch (glob)
>> -   $PYTHONDIR/mercurial/dispatch.py:* in _dispatch (glob)
>> -   $PYTHONDIR/mercurial/dispatch.py:* in runcommand (glob)
>> -   $PYTHONDIR/mercurial/dispatch.py:* in _runcommand (glob)
>> -   $PYTHONDIR/mercurial/dispatch.py:* in checkargs (glob)
>> -   $PYTHONDIR/mercurial/dispatch.py:* in <lambda> (glob)
>> -   $PYTHONDIR/mercurial/util.py:* in check (glob)
>> +   */mercurial/dispatch.py:* in run (glob)
>> +   */mercurial/dispatch.py:* in dispatch (glob)
>> +   */mercurial/dispatch.py:* in _runcatch (glob)
>> +   */mercurial/dispatch.py:* in _dispatch (glob)
>> +   */mercurial/dispatch.py:* in runcommand (glob)
>> +   */mercurial/dispatch.py:* in _runcommand (glob)
>> +   */mercurial/dispatch.py:* in checkargs (glob)
>> +   */mercurial/dispatch.py:* in <lambda> (glob)
>> +   */mercurial/util.py:* in check (glob)
>>      $TESTTMP/buggylocking.py:* in buggylocking (glob)
>>     $ hg properlocking
>>     $ hg nowaitlocking
>> @@ -118,7 +118,7 @@
>>     [255]
>>
>>     $ hg log -r "oldstyle()" -T '{rev}\n'
>> -  devel-warn: revset "oldstyle" use list instead of smartset, (upgrade your code) at: $PYTHONDIR/mercurial/revset.py:* (mfunc) (glob)
>> +  devel-warn: revset "oldstyle" use list instead of smartset, (upgrade your code) at: */mercurial/revset.py:* (mfunc) (glob)
>>     0
>>     $ hg oldanddeprecated
>>     devel-warn: foorbar is deprecated, go shopping
>> @@ -128,14 +128,14 @@
>>     devel-warn: foorbar is deprecated, go shopping
>>     (compatibility will be dropped after Mercurial-42.1337, update your code.) at:
>>      */hg:* in <module> (glob)
>> -   $PYTHONDIR/mercurial/dispatch.py:* in run (glob)
>> -   $PYTHONDIR/mercurial/dispatch.py:* in dispatch (glob)
>> -   $PYTHONDIR/mercurial/dispatch.py:* in _runcatch (glob)
>> -   $PYTHONDIR/mercurial/dispatch.py:* in _dispatch (glob)
>> -   $PYTHONDIR/mercurial/dispatch.py:* in runcommand (glob)
>> -   $PYTHONDIR/mercurial/dispatch.py:* in _runcommand (glob)
>> -   $PYTHONDIR/mercurial/dispatch.py:* in checkargs (glob)
>> -   $PYTHONDIR/mercurial/dispatch.py:* in <lambda> (glob)
>> -   $PYTHONDIR/mercurial/util.py:* in check (glob)
>> +   */mercurial/dispatch.py:* in run (glob)
>> +   */mercurial/dispatch.py:* in dispatch (glob)
>> +   */mercurial/dispatch.py:* in _runcatch (glob)
>> +   */mercurial/dispatch.py:* in _dispatch (glob)
>> +   */mercurial/dispatch.py:* in runcommand (glob)
>> +   */mercurial/dispatch.py:* in _runcommand (glob)
>> +   */mercurial/dispatch.py:* in checkargs (glob)
>> +   */mercurial/dispatch.py:* in <lambda> (glob)
>> +   */mercurial/util.py:* in check (glob)
>>      $TESTTMP/buggylocking.py:* in oldanddeprecated (glob)
>>     $ cd ..
>> _______________________________________________
>> Mercurial-devel mailing list
>> Mercurial-devel at mercurial-scm.org
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.mercurial-2Dscm.org_mailman_listinfo_mercurial-2Ddevel&d=CwIBaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=nuarHzhP1wi1T9iURRCj1A&m=SbYWjQoYToRV1j0bT1EswNd47RS_FToZMhSapUB2edw&s=RUWGUHBsVVmZjut38JZu_ILMOhjeByTDutGkY9FP61A&e=



More information about the Mercurial-devel mailing list