Bug 1292071 - Verify VCS checkout is pristine; r?dustin draft
authorGregory Szorc <gps@mozilla.com>
Mon, 17 Oct 2016 13:48:33 -0700
changeset 427629 ff92c7efaf8c1fa64080dcb59b5a039f462b727b
parent 427628 494617865df6396b061e870136a3d701bf35cc24
child 427630 943386bb6bd728428c5427f9db5082b3904b5153
push id33070
push userbmo:gps@mozilla.com
push dateThu, 20 Oct 2016 17:11:05 +0000
reviewersdustin
bugs1292071
milestone52.0a1
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
testing/docker/recipes/run-task
--- 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)