Bug 1342233 - Skip hg test in unit-symbolstore.py for git users; r?ted draft
authorMike Shal <mshal@mozilla.com>
Thu, 02 Mar 2017 15:12:42 -0500
changeset 493281 074938769da43f9d0261da05811f3c54eef2ea3b
parent 493227 77d5a39a4677ed8e32a7ed46561c962d807fa7b1
child 493282 7f029850eefc12c508c74741758be2fc9db4d834
push id47720
push userbmo:mshal@mozilla.com
push dateFri, 03 Mar 2017 19:15:30 +0000
reviewersted
bugs1342233
milestone54.0a1
Bug 1342233 - Skip hg test in unit-symbolstore.py for git users; r?ted MozReview-Commit-ID: DQDBsD7q9Wf
toolkit/crashreporter/tools/unit-symbolstore.py
--- a/toolkit/crashreporter/tools/unit-symbolstore.py
+++ b/toolkit/crashreporter/tools/unit-symbolstore.py
@@ -12,16 +12,17 @@ import shutil
 import struct
 import subprocess
 import sys
 import tempfile
 import unittest
 
 from mock import patch
 from mozpack.manifests import InstallManifest
+import mozpack.path as mozpath
 
 import symbolstore
 
 # Some simple functions to mock out files that the platform-specific dumpers will accept.
 # dump_syms itself will not be run (we mock that call out), but we can't override
 # the ShouldProcessFile method since we actually want to test that.
 def write_elf(filename):
     open(filename, "wb").write(struct.pack("<7B45x", 0x7f, ord("E"), ord("L"), ord("F"), 1, 1, 1))
@@ -567,17 +568,20 @@ class TestFunctional(HelperMixin, unitte
                          'should have one filename in the output')
         symbol_file = os.path.join(self.test_dir, lines[0])
         self.assertTrue(os.path.isfile(symbol_file))
         symlines = open(symbol_file, 'r').readlines()
         file_lines = filter(lambda x: x.startswith('FILE') and 'nsBrowserApp.cpp' in x, symlines)
         self.assertTrue(len(file_lines) >= 1,
                          'should have nsBrowserApp.cpp FILE line')
         filename = file_lines[0].split(None, 2)[2]
-        self.assertEqual('hg:', filename[:3])
+
+        # Skip this check for local git repositories.
+        if os.path.isdir(mozpath.join(self.topsrcdir, '.hg')):
+            self.assertEqual('hg:', filename[:3])
 
 
 if __name__ == '__main__':
     # use ThreadPoolExecutor to use threading instead of processes so
     # that our mocking/module-patching works.
     symbolstore.Dumper.GlobalInit(concurrent.futures.ThreadPoolExecutor)
 
     mozunit.main()