Patchwork tests: don't bother supporting test case names with exotic characters

login
register
mail settings
Submitter Augie Fackler
Date June 12, 2018, 10:18 p.m.
Message ID <05a80f347ad401bdb8c3.1528841928@augie-macbookpro2.roam.corp.google.com>
Download mbox | patch
Permalink /patch/32096/
State New
Headers show

Comments

Augie Fackler - June 12, 2018, 10:18 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1528841922 14400
#      Tue Jun 12 18:18:42 2018 -0400
# Node ID 05a80f347ad401bdb8c37782d6251a40aaf9cf2a
# Parent  f9c426385853657be0082f63567a1e78a3d5474b
tests: don't bother supporting test case names with exotic characters

[a-z], [0-9] and - seem sufficient per the follow-up on the initial
review thread, and this test is busted on Windows because of the
illegal filenames it produces.
Matt Harbison - June 13, 2018, 1:43 a.m.
On Tue, 12 Jun 2018 18:18:48 -0400, Augie Fackler <raf@durin42.com> wrote:

> # HG changeset patch
> # User Augie Fackler <augie@google.com>
> # Date 1528841922 14400
> #      Tue Jun 12 18:18:42 2018 -0400
> # Node ID 05a80f347ad401bdb8c37782d6251a40aaf9cf2a
> # Parent  f9c426385853657be0082f63567a1e78a3d5474b
> tests: don't bother supporting test case names with exotic characters

This also works, thanks.

Boris's patch might be better, as it maintains test coverage, and drops  
the bad characters:

	https://phab.mercurial-scm.org/D3721

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
@@ -1643,74 +1643,46 @@  Support ignoring invalid test cases
 Support running complex test cases names
 
   $ cat > test-cases-advanced-cases.t <<'EOF'
-  > #testcases simple case-with-dashes casewith!@#$%^&*()chars
+  > #testcases simple case-with-dashes-and-digits-1234
   >   $ echo $TESTCASE
   >   simple
   > EOF
 
   $ cat test-cases-advanced-cases.t
-  #testcases simple case-with-dashes casewith!@#$%^&*()chars
+  #testcases simple case-with-dashes-and-digits-1234
     $ echo $TESTCASE
     simple
 
   $ rt test-cases-advanced-cases.t
   
   --- $TESTTMP/anothertests/cases/test-cases-advanced-cases.t
-  +++ $TESTTMP/anothertests/cases/test-cases-advanced-cases.t.case-with-dashes.err
+  +++ $TESTTMP/anothertests/cases/test-cases-advanced-cases.t.case-with-dashes-and-digits-1234.err
   @@ -1,3 +1,3 @@
-   #testcases simple case-with-dashes casewith!@#$%^&*()chars
+   #testcases simple case-with-dashes-and-digits-1234
      $ echo $TESTCASE
   -  simple
-  +  case-with-dashes
+  +  case-with-dashes-and-digits-1234
   
-  ERROR: test-cases-advanced-cases.t#case-with-dashes output changed
-  !
-  --- $TESTTMP/anothertests/cases/test-cases-advanced-cases.t
-  +++ $TESTTMP/anothertests/cases/test-cases-advanced-cases.t.casewith!@#$%^&*()chars.err
-  @@ -1,3 +1,3 @@
-   #testcases simple case-with-dashes casewith!@#$%^&*()chars
-     $ echo $TESTCASE
-  -  simple
-  +  casewith!@#$%^&*()chars
-  
-  ERROR: test-cases-advanced-cases.t#casewith!@#$%^&*()chars output changed
+  ERROR: test-cases-advanced-cases.t#case-with-dashes-and-digits-1234 output changed
   !.
-  Failed test-cases-advanced-cases.t#case-with-dashes: output changed
-  Failed test-cases-advanced-cases.t#casewith!@#$%^&*()chars: output changed
-  # Ran 3 tests, 0 skipped, 2 failed.
-  python hash seed: * (glob)
-  [1]
-
-  $ rt "test-cases-advanced-cases.t#case-with-dashes"
-  
-  --- $TESTTMP/anothertests/cases/test-cases-advanced-cases.t
-  +++ $TESTTMP/anothertests/cases/test-cases-advanced-cases.t.case-with-dashes.err
-  @@ -1,3 +1,3 @@
-   #testcases simple case-with-dashes casewith!@#$%^&*()chars
-     $ echo $TESTCASE
-  -  simple
-  +  case-with-dashes
-  
-  ERROR: test-cases-advanced-cases.t#case-with-dashes output changed
-  !
-  Failed test-cases-advanced-cases.t#case-with-dashes: output changed
-  # Ran 1 tests, 0 skipped, 1 failed.
+  Failed test-cases-advanced-cases.t#case-with-dashes-and-digits-1234: output changed
+  # Ran 2 tests, 0 skipped, 1 failed.
   python hash seed: * (glob)
   [1]
 
-  $ rt "test-cases-advanced-cases.t#casewith!@#$%^&*()chars"
+  $ rt "test-cases-advanced-cases.t#case-with-dashes-and-digits-1234"
   
   --- $TESTTMP/anothertests/cases/test-cases-advanced-cases.t
-  +++ $TESTTMP/anothertests/cases/test-cases-advanced-cases.t.casewith!@#$%^&*()chars.err
+  +++ $TESTTMP/anothertests/cases/test-cases-advanced-cases.t.case-with-dashes-and-digits-1234.err
   @@ -1,3 +1,3 @@
-   #testcases simple case-with-dashes casewith!@#$%^&*()chars
+   #testcases simple case-with-dashes-and-digits-1234
      $ echo $TESTCASE
   -  simple
-  +  casewith!@#$%^&*()chars
+  +  case-with-dashes-and-digits-1234
   
-  ERROR: test-cases-advanced-cases.t#casewith!@#$%^&*()chars output changed
+  ERROR: test-cases-advanced-cases.t#case-with-dashes-and-digits-1234 output changed
   !
-  Failed test-cases-advanced-cases.t#casewith!@#$%^&*()chars: output changed
+  Failed test-cases-advanced-cases.t#case-with-dashes-and-digits-1234: output changed
   # Ran 1 tests, 0 skipped, 1 failed.
   python hash seed: * (glob)
   [1]