Mercurial > hg
changeset 40488:d95358143ce6
catapult: fix broken run-tests catapult tracing
Commit 97f52862b1bd 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.
Differential Revision: https://phab.mercurial-scm.org/D5214
author | Kyle Lippincott <spectral@google.com> |
---|---|
date | Thu, 01 Nov 2018 16:44:32 -0700 |
parents | 78e5b9d815fa |
children | a9e00c48c5ef |
files | tests/run-tests.py |
diffstat | 1 files changed, 19 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/run-tests.py Sat Nov 03 23:24:15 2018 +0530 +++ b/tests/run-tests.py Thu Nov 01 16:44:32 2018 -0700 @@ -1382,20 +1382,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 = [] @@ -1424,7 +1431,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 @@ -1536,6 +1542,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):