[PATCH v3] run-tests: try to provide a test.env file RFC

Yuya Nishihara yuya at tcha.org
Tue Mar 29 10:05:51 EDT 2016


On Thu, 24 Mar 2016 15:16:27 -0500, timeless wrote:
> # HG changeset patch
> # User timeless <timeless at mozdev.org>
> # Date 1450782416 0
> #      Tue Dec 22 11:06:56 2015 +0000
> # Node ID 1187c2c232ee7f23711dc3c0857ea2e1cc92a42d
> # Parent  1a1e4350b560cf2f49fe235d2e5168471877462d
> run-tests: try to provide a test.env file RFC
> 
> This is a step to providing an environment file that people can use
> to reproduce a failing test environment.

I think this is good direction. A couple of nits follow.

> Long term, it'd be helpful if this included code or instructions
> to empty the environment too...

(+CC Piotr Listkiewicz as he seems to work on test environment)

> --- a/tests/run-tests.py
> +++ b/tests/run-tests.py
> @@ -730,6 +730,16 @@
>              log('\nKeeping testtmp dir: %s\nKeeping threadtmp dir: %s' %
>                  (self._testtmp.decode('utf-8'),
>                   self._threadtmp.decode('utf-8')))
> +            env = self._getenv()
> +            def format(k, v):
> +                return 'export %s="%s"\n' % (k, v.replace('"', r'\"'))

"export X=Y" is bashism.

> +            if os.name == 'nt':
> +                def format(k, v):
> +                    return 'set %s=%s\r\n' % (k, v.replace('&', '^&'))

Perhaps we won't need Windows batch file since most of us will use MSYS bash
or zsh to run tests on Windows.


More information about the Mercurial-devel mailing list