[Request] [+ ] D9557: run-tests: fix `HGTESTEXTRAEXTENSIONS` with py3

mharbison72 (Matt Harbison) phabricator at mercurial-scm.org
Thu Dec 10 04:29:07 UTC 2020


mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Since `extensions` was a str and `section` bytes, it never populated anything.
  If it had, it would have put bytes into the environment dictionary that is all
  str.  As everything starts and ends as str, remove the incomplete attempt at
  byteification.  It doesn't appear that we had any test coverage of this bit of
  code, so also add a non-extension config to make sure it is filtered out
  properly.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9557

AFFECTED FILES
  tests/run-tests.py
  tests/test-run-tests.t

CHANGE DETAILS

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
@@ -1956,9 +1956,12 @@
   $ cat << EOF >> test-config-opt.t
   >   $ hg init test-config-opt
   >   $ hg -R test-config-opt purge
+  >   $ echo "HGTESTEXTRAEXTENSIONS: \$HGTESTEXTRAEXTENSIONS"
+  >   HGTESTEXTRAEXTENSIONS: purge
   > EOF
 
-  $ rt --extra-config-opt extensions.purge= test-config-opt.t
+  $ rt --extra-config-opt extensions.purge= \
+  >    --extra-config-opt not.an.extension=True test-config-opt.t
   running 1 tests using 1 parallel processes 
   .
   # Ran 1 tests, 0 skipped, 0 failed.
diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -1364,14 +1364,14 @@
 
         extraextensions = []
         for opt in self._extraconfigopts:
-            section, key = _sys2bytes(opt).split(b'.', 1)
+            section, key = opt.split('.', 1)
             if section != 'extensions':
                 continue
-            name = key.split(b'=', 1)[0]
+            name = key.split('=', 1)[0]
             extraextensions.append(name)
 
         if extraextensions:
-            env['HGTESTEXTRAEXTENSIONS'] = b' '.join(extraextensions)
+            env['HGTESTEXTRAEXTENSIONS'] = ' '.join(extraextensions)
 
         # LOCALIP could be ::1 or 127.0.0.1. Useful for tests that require raw
         # IP addresses.



To: mharbison72, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20201210/77c6af73/attachment.html>


More information about the Mercurial-patches mailing list