D5214: catapult: fix broken run-tests catapult tracing
spectral (Kyle Lippincott)
phabricator at mercurial-scm.org
Fri Nov 2 00:26:22 UTC 2018
spectral created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
Commit https://phab.mercurial-scm.org/rHG97f52862b1bd3de913261e0aba7e1a35ceb9de12 thought this block was misindented, but it was not; the
indentation after that commit means we never log a catapult trace for individual
commands. Also, we've never emitted the "end" trace line when the test was
finished, so the trace viewer claims that these "did not finish", fixing that as
well.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D5214
AFFECTED FILES
tests/run-tests.py
CHANGE DETAILS
diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -1366,20 +1366,27 @@
session = str(uuid.uuid4())
if PYTHON3:
session = session.encode('ascii')
- def toggletrace(cmd):
+ hgcatapult = os.getenv('HGCATAPULTSERVERPIPE')
+ def toggletrace(cmd=None):
+ if not hgcatapult or hgcatapult == os.devnull:
+ return
+
+ if active:
+ script.append(
+ b'echo END %s %s >> "$HGCATAPULTSERVERPIPE"\n' % (
+ session, active[0]))
+ if cmd is None:
+ return
+
if isinstance(cmd, str):
quoted = shellquote(cmd.strip())
else:
quoted = shellquote(cmd.strip().decode('utf8')).encode('utf8')
quoted = quoted.replace(b'\\', b'\\\\')
- if active:
- script.append(
- b'echo END %s %s >> "$HGCATAPULTSERVERPIPE"\n' % (
- session, active[0]))
- script.append(
- b'echo START %s %s >> "$HGCATAPULTSERVERPIPE"\n' % (
- session, quoted))
- active[0:] = [quoted]
+ script.append(
+ b'echo START %s %s >> "$HGCATAPULTSERVERPIPE"\n' % (
+ session, quoted))
+ active[0:] = [quoted]
script = []
@@ -1408,7 +1415,6 @@
if os.getenv('MSYSTEM'):
script.append(b'alias pwd="pwd -W"\n')
- hgcatapult = os.getenv('HGCATAPULTSERVERPIPE')
if hgcatapult and hgcatapult != os.devnull:
# Kludge: use a while loop to keep the pipe from getting
# closed by our echo commands. The still-running file gets
@@ -1520,6 +1526,9 @@
if skipping is not None:
after.setdefault(pos, []).append(' !!! missing #endif\n')
addsalt(n + 1, False)
+ # Need to end any current per-command trace
+ if active:
+ toggletrace()
return salt, script, after, expected
def _processoutput(self, exitcode, output, salt, after, expected):
To: spectral, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list