mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 01:07:15 +03:00
3cafa7d1f2
Shipping your own `run-tests.py` is a bad practice as the custom version will slowly diverge from important fixes and upgrade from the upstream one. Using the core one is simple and we should use it. I'm not convinced by the arguments used in the re-installation (e221a52), - It is easy to run the test against any version of Mercurial including the installed one using `--with-hg=`, - If you have people contributing to this level of extensions, having them clone Mercurial is fairly cheap. If this is really seen a blocker, completing the Mercurial's upstream plan to have run-tests.py installable as a developer tools seems a cheap way to move forward instead, - If you own a complex installation with multiple Mercurial related dependencies, you already have a way to handle version dependency in this context and your contributor can use this very same infrastructure to make sure they run at the right version. And they probably should use it already anyway to make sure they are testing the stack properly. This changesets also install a README explaining how to obtains the test runner and runs it against various Mercurial version.
25 lines
516 B
Python
Executable File
25 lines
516 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
import sys
|
|
import os
|
|
|
|
os.chdir(os.getenv('TESTTMP'))
|
|
|
|
if sys.argv[1] != "user@dummy":
|
|
sys.exit(-1)
|
|
|
|
os.environ["SSH_CLIENT"] = "127.0.0.1 1 2"
|
|
|
|
log = open("dummylog", "ab")
|
|
log.write("Got arguments")
|
|
for i, arg in enumerate(sys.argv[1:]):
|
|
log.write(" %d:%s" % (i + 1, arg))
|
|
log.write("\n")
|
|
log.close()
|
|
hgcmd = sys.argv[2]
|
|
if os.name == 'nt':
|
|
# hack to make simple unix single quote quoting work on windows
|
|
hgcmd = hgcmd.replace("'", '"')
|
|
r = os.system(hgcmd)
|
|
sys.exit(bool(r))
|