[PATCH V2] tests: make run-tests.py invokes tests with needed variables only (issue5069)

Pierre-Yves David pierre-yves.david at ens-lyon.org
Mon Mar 28 12:38:49 EDT 2016



On 03/28/2016 04:52 AM, liscju wrote:
> # HG changeset patch
> # User liscju <piotr.listkiewicz at gmail.com>
> # Date 1459165803 -7200
> #      Mon Mar 28 13:50:03 2016 +0200
> # Node ID 45bfa9d1d1b38f3f3e938b6246337ecb90bb397d
> # Parent  345f4fa4cc8912bb722ad3e35d68858487420bc6
> tests: make run-tests.py invokes tests with needed variables only (issue5069)
>
> It introduces usedenvvariables list which contains all used environment
> variables used in run-tests.py and in tests directory.

We still need a story for extending this list in third party extension. 
As pointed in my previous reply:

https://www.mercurial-scm.org/pipermail/mercurial-devel/2016-March/081996.html

An easy way forward would be to have a file in the tests directory that 
run-test.py would read to update this list. Such file will probably 
needed for more than just env variable so we have to be careful here.

> diff -r 345f4fa4cc89 -r 45bfa9d1d1b3 tests/run-tests.py
> --- a/tests/run-tests.py	Fri Mar 25 16:23:23 2016 -0500
> +++ b/tests/run-tests.py	Mon Mar 28 13:50:03 2016 +0200
> @@ -69,6 +69,18 @@ except ImportError:
>   from xml.dom import minidom
>   import unittest
>
> +usedenvvariables = set([
> +    'BINDIR', 'CHGHG', 'CHGSOCKNAME', 'COLUMNS',
> +    'COVERAGE_DIR', 'COVERAGE_PROCESS_START',
> +    'DAEMON_PIDS', 'EMAIL', 'HGEDITOR', 'HGENCODING',
> +    'HGENCODINGMODE', 'HGMERGE', 'HGRCPATH',
> +    'HGTEST_RUN_TESTS_PURE', 'HGTEST_SLOW', 'HGTMP',
> +    'HGUSER', 'HOME', 'LANG', 'LANGUAGE', 'LC_ALL',
> +    'MSYSTEM', 'PATH', 'PYTHON', 'PYTHON3',
> +    'PYTHONHASHSEED', 'RUNTESTDIR', 'TERM', 'TESTDIR',
> +    'TESTTMP', 'TMP', 'TZ', 'PYTHONPATH'
> +])
> +

Can we have the list expanded ? (on value per line) this make diff for 
change to the list most more friendly.

Cheers,

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list