Bug 1292071 - Verify VCS checkout is pristine; r?dustin
The working directory state in automation is somehow incorrect. To
help debug what is doing on, we increase the verbosity of the
`hg robustcheckout` command and perform an explicit `hg status`
after `hg robustcheckout` and verify that the working directory has
no differences from the pristine checkout state.
`hg status` can be expensive. So this is meant as a temporary
stop-gap until we can figure out the underlying problem.
MozReview-Commit-ID: LIHmoMlxNsG
--- a/testing/docker/recipes/run-task
+++ b/testing/docker/recipes/run-task
@@ -129,16 +129,29 @@ def vcs_checkout(source_repo, dest, base
source_repo, dest,
])
res = run_and_prefix_output(b'vcs', args,
extra_env={b'PYTHONUNBUFFERED': b'1'})
if res:
sys.exit(res)
+ # Meant to be temporary to flush out what's going on in bug 1292071.
+ print_line(b'vcs', b'verifying working directory is clean\n')
+ status = subprocess.check_output([b'/usr/bin/hg', b'status', b'--all'],
+ cwd=dest, stderr=subprocess.STDOUT)
+ status = status.strip()
+ status_lines = [l for l in status.splitlines() if not l.startswith(b'C ')]
+ if status_lines:
+ print_line(b'vcs', b'Error: checkout is not pristine! '
+ b'Report this in bug 1292071\n')
+ for line in status_lines:
+ print_line(b'vcs', b'%s\n' % line)
+ sys.exit(1)
+
# Update the current revision hash and ensure that it is well formed.
revision = subprocess.check_output(
[b'/usr/bin/hg', b'log',
b'--rev', b'.',
b'--template', b'{node}'],
cwd=dest)
assert re.match('^[a-f0-9]{40}$', revision)