Patchwork [06,of,11,FOR-REFERENCE] test-run-tests.t: tests the --retest option

login
register
mail settings
Submitter Pierre-Yves David
Date June 2, 2014, 7:54 p.m.
Message ID <760fc63f9f5da9b37dd4.1401738881@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/4920/
State Superseded
Commit 02cd29156d5d571e161360c783dc5e8d2708be0b
Headers show

Comments

Pierre-Yves David - June 2, 2014, 7:54 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1401477077 25200
#      Fri May 30 12:11:17 2014 -0700
# Node ID 760fc63f9f5da9b37dd4a9effd5a315260426143
# Parent  858b3df64bb0a72c055e44479a53801dfceb5d4f
test-run-tests.t: tests the --retest option
Pierre-Yves David - June 2, 2014, 8:15 p.m.
On 06/02/2014 12:54 PM, pierre-yves.david@ens-lyon.org wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@fb.com>
> # Date 1401477077 25200
> #      Fri May 30 12:11:17 2014 -0700
> # Node ID 760fc63f9f5da9b37dd4a9effd5a315260426143
> # Parent  858b3df64bb0a72c055e44479a53801dfceb5d4f
> test-run-tests.t: tests the --retest option

With the new code, This test fails with the following output:

   --- /home/pyd/src/mercurial-dev/tests/test-run-tests.t
   +++ /home/pyd/src/mercurial-dev/tests/test-run-tests.t.err
   @@ -45,7 +45,7 @@
    ====================

      $ $TESTDIR/run-tests.py --with-hg=`which hg` --retest
   -
   +  i
      --- $TESTTMP/test-failure.t
      +++ $TESTTMP/test-failure.t.err
      @@ -1,2 +1,2 @@
   @@ -53,9 +53,7 @@
      -  rataxes
      +  babar

   -  ERROR: test-failure.t output changed
   -  !
      Failed test-failure.t: output changed
   -  # Ran 1 tests, 1 skipped, 0 warned, 1 failed.
   +  # Ran 0 tests, 1 skipped, 0 warned, 1 failed.
      python hash seed: * (glob)
      [1]

Beside the previously spotted change, we have two difference here:

1. The skipped test issue a "i", This is a bit inconvenient but not 
terrible.

2. The "# Ran 1 tests, 1 skipped, 0 warned, 1 failed." line got the 
number of ran test totally wrong. Sound like a regression that requires 
a fix to me.

>
> diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t
> --- a/tests/test-run-tests.t
> +++ b/tests/test-run-tests.t
> @@ -40,5 +40,24 @@ failing test
>     !.
>     Failed test-failure.t: output changed
>     # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
>     python hash seed: * (glob)
>     [1]
> +
> +test for --retest
> +====================
> +
> +  $ $TESTDIR/run-tests.py --with-hg=`which hg` --retest
> +
> +  --- $TESTTMP/test-failure.t
> +  +++ $TESTTMP/test-failure.t.err
> +  @@ -1,2 +1,2 @@
> +     $ echo babar
> +  -  rataxes
> +  +  babar
> +
> +  ERROR: test-failure.t output changed
> +  !
> +  Failed test-failure.t: output changed
> +  # Ran 1 tests, 1 skipped, 0 warned, 1 failed.
> +  python hash seed: * (glob)
> +  [1]
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>

Patch

diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t
--- a/tests/test-run-tests.t
+++ b/tests/test-run-tests.t
@@ -40,5 +40,24 @@  failing test
   !.
   Failed test-failure.t: output changed
   # Ran 2 tests, 0 skipped, 0 warned, 1 failed.
   python hash seed: * (glob)
   [1]
+
+test for --retest
+====================
+
+  $ $TESTDIR/run-tests.py --with-hg=`which hg` --retest
+  
+  --- $TESTTMP/test-failure.t
+  +++ $TESTTMP/test-failure.t.err
+  @@ -1,2 +1,2 @@
+     $ echo babar
+  -  rataxes
+  +  babar
+  
+  ERROR: test-failure.t output changed
+  !
+  Failed test-failure.t: output changed
+  # Ran 1 tests, 1 skipped, 0 warned, 1 failed.
+  python hash seed: * (glob)
+  [1]