Patchwork [1,of,2] runtests: rename 'run-tests.py' to Mercurial style 'runtests'

login
register
mail settings
Submitter Mads Kiilerich
Date Jan. 15, 2013, 1:23 a.m.
Message ID <9f036303309a2af19983.1358212998@localhost6.localdomain6>
Download mbox | patch
Permalink /patch/626/
State Rejected
Headers show

Comments

Mads Kiilerich - Jan. 15, 2013, 1:23 a.m.
# HG changeset patch
# User Mads Kiilerich <mads@kiilerich.com>
# Date 1358212950 -3600
# Node ID 9f036303309a2af199832165ba00b24b8a4df16f
# Parent  cf5c76017e11ed711d02824117baf770e45c2655
runtests: rename 'run-tests.py' to Mercurial style 'runtests'

The '-' is inconsistent with the general preference in Mercurial, and the '.py'
is just inconvenient and cause inconsistency when referring to the tool. It had
'-' in the name and could thus not be used as a Python module anyway.

This makes it less obvious that it can be run as 'python2x runtests' ... but
those who want to do that can figure it out.

It is slightly inconvenient that buildbots, command line histories and fingers
has to be re-trained.
Adrian Buehlmann - Jan. 15, 2013, 8:13 a.m.
On 2013-01-15 02:23, Mads Kiilerich wrote:
> It is slightly inconvenient that buildbots, command line histories and fingers
> has to be re-trained.

Indeed.

And there are additional inconveniences.

So, I'm -1 for removing the .py suffix.

But I also don't really see the point of removing the "-". Given the
problems the rename will cause.
Idan Kamara - Jan. 15, 2013, 9:48 a.m.
On Tue, Jan 15, 2013 at 3:23 AM, Mads Kiilerich <mads@kiilerich.com> wrote:
>
> # HG changeset patch
> # User Mads Kiilerich <mads@kiilerich.com>
> # Date 1358212950 -3600
> # Node ID 9f036303309a2af199832165ba00b24b8a4df16f
> # Parent  cf5c76017e11ed711d02824117baf770e45c2655
> runtests: rename 'run-tests.py' to Mercurial style 'runtests'
>
> The '-' is inconsistent with the general preference in Mercurial, and the
> '.py'
> is just inconvenient and cause inconsistency when referring to the tool.
> It had
> '-' in the name and could thus not be used as a Python module anyway.

Can't think why you'd want to do that, but it is possible by invoking
import directly, via importlib or __import__.

>
> This makes it less obvious that it can be run as 'python2x runtests' ...
> but
> those who want to do that can figure it out.
>
> It is slightly inconvenient that buildbots, command line histories and
> fingers
> has to be re-trained.

..and aliases people have.

-1 as well, it seems the advantages don't outweigh the
disadvantages.
Pierre-Yves David - Jan. 15, 2013, 4:08 p.m.
On Tue, Jan 15, 2013 at 02:23:18AM +0100, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <mads@kiilerich.com>
> # Date 1358212950 -3600
> # Node ID 9f036303309a2af199832165ba00b24b8a4df16f
> # Parent  cf5c76017e11ed711d02824117baf770e45c2655
> runtests: rename 'run-tests.py' to Mercurial style 'runtests'
> 
> The '-' is inconsistent with the general preference in Mercurial, and the '.py'
> is just inconvenient and cause inconsistency when referring to the tool. It had
> '-' in the name and could thus not be used as a Python module anyway.

Inconsistent with the general preference in Mercurial?

run-test.py stand in directory were there is 526 file with a "-" do you plan to drop them too ;-) ?

I fails to see why .py in inconvenient too.

I've not strong opposition for this change *On a general basis* but I a bit
puzzled about why you do not like it as is


> It is slightly inconvenient that buildbots, command line histories and fingers
> has to be re-trained.

I think we have better to do than break CI during the last two week before a major release

I'm -1 for this before 1 feb
Bryan O'Sullivan - Jan. 15, 2013, 6:46 p.m.
On Mon, Jan 14, 2013 at 5:23 PM, Mads Kiilerich <mads@kiilerich.com> wrote:
> runtests: rename 'run-tests.py' to Mercurial style 'runtests'

No thank you. This has no practical benefit, and will break lots of
people and automated tools.

Patch

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -89,10 +89,10 @@  dist-notests:	doc MANIFEST.in
 check: tests
 
 tests:
-	cd tests && $(PYTHON) run-tests.py $(TESTFLAGS)
+	cd tests && $(PYTHON) runtests $(TESTFLAGS)
 
 test-%:
-	cd tests && $(PYTHON) run-tests.py $(TESTFLAGS) $@
+	cd tests && $(PYTHON) runtests $(TESTFLAGS) $@
 
 update-pot: i18n/hg.pot
 
diff --git a/tests/README b/tests/README
--- a/tests/README
+++ b/tests/README
@@ -1,7 +1,7 @@ 
 To run the tests, do:
 
 cd tests/
-python run-tests.py
+python runtests
 
 See http://mercurial.selenic.com/wiki/WritingTests for
 more information on writing tests.
diff --git a/tests/blacklists/README b/tests/blacklists/README
--- a/tests/blacklists/README
+++ b/tests/blacklists/README
@@ -1,8 +1,8 @@ 
-Put here definitions of blacklists for run-tests.py
+Put here definitions of blacklists for runtests
 
 Create a file per blacklist. Each file should list the names of tests that you
 want to be skipped.
-File names are meant to be used as targets for run-tests.py --blacklist
+File names are meant to be used as targets for runtests --blacklist
 option.
 Lines starting with # are ignored. White spaces are stripped.
 
@@ -10,5 +10,5 @@  e.g. if you create a blacklist/example f
  test-hgrc
  # some comment
  test-help
-then calling "run-tests.py --blacklist blacklists/example" will exclude
+then calling "runtests --blacklist blacklists/example" will exclude
 test-hgrc and test-help from the list of tests to run.
diff --git a/tests/run-tests.py b/tests/runtests
rename from tests/run-tests.py
rename to tests/runtests
--- a/tests/run-tests.py
+++ b/tests/runtests
@@ -1,6 +1,6 @@ 
 #!/usr/bin/env python
 #
-# run-tests.py - Run a set of tests on Mercurial
+# runtests - Run a set of tests on Mercurial
 #
 # Copyright 2006 Matt Mackall <mpm@selenic.com>
 #
@@ -18,23 +18,23 @@ 
 # sample of test scripts.  For example:
 #
 #  1) serial, no coverage, temp install:
-#      ./run-tests.py test-s*
+#      ./runtests test-s*
 #  2) serial, no coverage, local hg:
-#      ./run-tests.py --local test-s*
+#      ./runtests --local test-s*
 #  3) serial, coverage, temp install:
-#      ./run-tests.py -c test-s*
+#      ./runtests -c test-s*
 #  4) serial, coverage, local hg:
-#      ./run-tests.py -c --local test-s*      # unsupported
+#      ./runtests -c --local test-s*      # unsupported
 #  5) parallel, no coverage, temp install:
-#      ./run-tests.py -j2 test-s*
+#      ./runtests -j2 test-s*
 #  6) parallel, no coverage, local hg:
-#      ./run-tests.py -j2 --local test-s*
+#      ./runtests -j2 --local test-s*
 #  7) parallel, coverage, temp install:
-#      ./run-tests.py -j2 -c test-s*          # currently broken
+#      ./runtests -j2 -c test-s*          # currently broken
 #  8) parallel, coverage, local install:
-#      ./run-tests.py -j2 -c --local test-s*  # unsupported (and broken)
+#      ./runtests -j2 -c --local test-s*  # unsupported (and broken)
 #  9) parallel, custom tmp dir:
-#      ./run-tests.py -j2 --tmpdir /tmp/myhgtests
+#      ./runtests -j2 --tmpdir /tmp/myhgtests
 #
 # (You could use any subset of the tests: test-s* happens to match
 # enough that it's worth doing parallel runs, few enough that it
@@ -452,7 +452,7 @@  def installhg(options):
 
     hgbat = os.path.join(BINDIR, 'hg.bat')
     if os.path.isfile(hgbat):
-        # hg.bat expects to be put in bin/scripts while run-tests.py
+        # hg.bat expects to be put in bin/scripts while runtests
         # installation layout put it in bin/ directly. Fix it
         f = open(hgbat, 'rb')
         data = f.read()
@@ -1323,7 +1323,7 @@  def main():
         os.environ["PATH"] = os.pathsep.join(path)
 
         # Include TESTDIR in PYTHONPATH so that out-of-tree extensions
-        # can run .../tests/run-tests.py test-foo where test-foo
+        # can run .../tests/runtests test-foo where test-foo
         # adds an extension to HGRC
         pypath = [PYTHONDIR, TESTDIR]
         # We have to augment PYTHONPATH, rather than simply replacing
diff --git a/tests/test-symlink-os-yes-fs-no.py b/tests/test-symlink-os-yes-fs-no.py
--- a/tests/test-symlink-os-yes-fs-no.py
+++ b/tests/test-symlink-os-yes-fs-no.py
@@ -6,7 +6,7 @@  BUNDLEPATH = os.path.join(TESTDIR, 'bund
 
 # only makes sense to test on os which supports symlinks
 if not getattr(os, "symlink", False):
-    sys.exit(80) # SKIPPED_STATUS defined in run-tests.py
+    sys.exit(80) # SKIPPED_STATUS defined in runtests
 
 u = ui.ui()
 # hide outer repo