Bug 1342233 - Skip hg test in unit-symbolstore.py for git users; r?ted
MozReview-Commit-ID: DQDBsD7q9Wf
--- 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()