Patchwork run-tests: report missing feature for skipped tests

login
register
mail settings
Submitter timeless@mozdev.org
Date Dec. 22, 2015, 8:08 a.m.
Message ID <ff25f50d7970722227a3.1450771707@waste.org>
Download mbox | patch
Permalink /patch/12237/
State Superseded
Commit 80b53082a3538475ef88b0767fdfbffbe569e734
Delegated to: Yuya Nishihara
Headers show

Comments

timeless@mozdev.org - Dec. 22, 2015, 8:08 a.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1450771203 0
#      Tue Dec 22 08:00:03 2015 +0000
# Node ID ff25f50d7970722227a391b806c703c42feb4d93
# Parent  3dea4eae4eebac11741f0c1dc5dcd9c88d8f4554
run-tests: report missing feature for skipped tests
Yuya Nishihara - Dec. 23, 2015, 9:56 a.m.
On Tue, 22 Dec 2015 02:08:27 -0600, timeless wrote:
> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1450771203 0
> #      Tue Dec 22 08:00:03 2015 +0000
> # Node ID ff25f50d7970722227a391b806c703c42feb4d93
> # Parent  3dea4eae4eebac11741f0c1dc5dcd9c88d8f4554
> run-tests: report missing feature for skipped tests
> 
> diff --git a/tests/run-tests.py b/tests/run-tests.py
> --- a/tests/run-tests.py
> +++ b/tests/run-tests.py
> @@ -940,7 +940,7 @@
>              sys.exit(1)
>  
>          if ret != 0:
> -            return False
> +            return stdout
>  
>          if 'slow' in reqs:
>              self._timeout = self._slowtimeout
> @@ -989,8 +989,9 @@
>                  lsplit = l.split()
>                  if len(lsplit) < 2 or lsplit[0] != b'#require':
>                      after.setdefault(pos, []).append('  !!! invalid #require\n')
> -                if not self._hghave(lsplit[1:]):
> -                    script = [b"exit 80\n"]
> +                haveresult = self._hghave(lsplit[1:])
> +                if haveresult is not True:
> +                    script = [b'echo "%s"\nexit 80\n' % haveresult]

Returning True|message seems confusing.
Can it be None|message or (skipping, message) ?

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -940,7 +940,7 @@ 
             sys.exit(1)
 
         if ret != 0:
-            return False
+            return stdout
 
         if 'slow' in reqs:
             self._timeout = self._slowtimeout
@@ -989,8 +989,9 @@ 
                 lsplit = l.split()
                 if len(lsplit) < 2 or lsplit[0] != b'#require':
                     after.setdefault(pos, []).append('  !!! invalid #require\n')
-                if not self._hghave(lsplit[1:]):
-                    script = [b"exit 80\n"]
+                haveresult = self._hghave(lsplit[1:])
+                if haveresult is not True:
+                    script = [b'echo "%s"\nexit 80\n' % haveresult]
                     break
                 after.setdefault(pos, []).append(l)
             elif l.startswith(b'#if'):
@@ -999,7 +1000,7 @@ 
                     after.setdefault(pos, []).append('  !!! invalid #if\n')
                 if skipping is not None:
                     after.setdefault(pos, []).append('  !!! nested #if\n')
-                skipping = not self._hghave(lsplit[1:])
+                skipping = self._hghave(lsplit[1:]) is not True
                 after.setdefault(pos, []).append(l)
             elif l.startswith(b'#else'):
                 if skipping is None:
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
@@ -418,7 +418,7 @@ 
   > cat test-timeout.t >> test-slow-timeout.t
   $ rt --timeout=1 --slowtimeout=3 test-timeout.t test-slow-timeout.t
   st
-  Skipped test-slow-timeout.t: skipped
+  Skipped test-slow-timeout.t: missing feature: allow slow tests
   Failed test-timeout.t: timed out
   # Ran 1 tests, 1 skipped, 0 warned, 1 failed.
   python hash seed: * (glob)
@@ -460,7 +460,7 @@ 
   > EOF
   $ rt --nodiff
   !.s
-  Skipped test-skip.t: skipped
+  Skipped test-skip.t: missing feature: nail clipper
   Failed test-failure.t: output changed
   # Ran 2 tests, 1 skipped, 0 warned, 1 failed.
   python hash seed: * (glob)
@@ -468,14 +468,14 @@ 
 
   $ rt --keyword xyzzy
   .s
-  Skipped test-skip.t: skipped
+  Skipped test-skip.t: missing feature: nail clipper
   # Ran 2 tests, 2 skipped, 0 warned, 0 failed.
 
 Skips with xml
   $ rt --keyword xyzzy \
   >  --xunit=xunit.xml
   .s
-  Skipped test-skip.t: skipped
+  Skipped test-skip.t: missing feature: nail clipper
   # Ran 2 tests, 2 skipped, 0 warned, 0 failed.
   $ cat xunit.xml
   <?xml version="1.0" encoding="utf-8"?>
@@ -510,7 +510,7 @@ 
   
   ERROR: test-failure.t output changed
   !.s
-  Skipped test-skip.t: skipped
+  Skipped test-skip.t: missing feature: nail clipper
   Failed test-failure.t: output changed
   # Ran 2 tests, 1 skipped, 0 warned, 1 failed.
   python hash seed: * (glob)
@@ -558,7 +558,7 @@ 
    This is a noop statement so that
    this test is still more bytes than success.
   Accept this change? [n] ..s
-  Skipped test-skip.t: skipped
+  Skipped test-skip.t: missing feature: nail clipper
   # Ran 2 tests, 1 skipped, 0 warned, 0 failed.
 
   $ cat report.json
@@ -673,7 +673,7 @@ 
   > EOF
   $ rt $HGTEST_RUN_TESTS_PURE test-very-slow-test.t
   s
-  Skipped test-very-slow-test.t: skipped
+  Skipped test-very-slow-test.t: missing feature: allow slow tests
   # Ran 0 tests, 1 skipped, 0 warned, 0 failed.
   $ rt $HGTEST_RUN_TESTS_PURE --allow-slow-tests test-very-slow-test.t
   .