Bug 1451319 - Unset MINIDUMP_SAVE_PATH for mozcrash unit tests. draft
authorHenrik Skupin <mail@hskupin.info>
Thu, 05 Apr 2018 11:53:43 +0200
changeset 777776 0fb6ca7a548120bcc09db7322cfa2e6769db06db
parent 777562 071ee904485e21e19ca08456d32bce6825b77a26
push id105292
push userbmo:hskupin@gmail.com
push dateThu, 05 Apr 2018 10:29:21 +0000
bugs1451319
milestone61.0a1
Bug 1451319 - Unset MINIDUMP_SAVE_PATH for mozcrash unit tests. The build job on Windows sets the MINIDUMP_SAVE_PATH env variable, and because it isn't unset mozcrash copies all created minidump files from unittests to the "public/build" folder, which then get uploaded as artifacts. MozReview-Commit-ID: 6JNnRZGlOj3
testing/mozbase/mozcrash/tests/conftest.py
--- a/testing/mozbase/mozcrash/tests/conftest.py
+++ b/testing/mozbase/mozcrash/tests/conftest.py
@@ -12,17 +12,18 @@ import mozcrash
 def stackwalk(tmpdir_factory):
     stackwalk = tmpdir_factory.mktemp('stackwalk_binary').join('stackwalk')
     stackwalk.write('fake binary')
     stackwalk.chmod(0o744)
     return stackwalk
 
 
 @pytest.fixture
-def check_for_crashes(tmpdir, stackwalk):
+def check_for_crashes(tmpdir, monkeypatch, stackwalk):
+    monkeypatch.delenv('MINIDUMP_SAVE_PATH', raising=False)
 
     def wrapper(dump_directory=fspath(tmpdir),
                 symbols_path='symbols_path',
                 stackwalk_binary=fspath(stackwalk),
                 dump_save_path=None,
                 test_name=None,
                 quiet=True):
         return mozcrash.check_for_crashes(dump_directory,
@@ -81,8 +82,9 @@ def mock_popen(monkeypatch):
 
         def communicate(self):
             return (u'Stackwalk command: {}'.format(" ".join(self.args)), "")
 
         def wait(self):
             return self.returncode
 
     monkeypatch.setattr(mozcrash.mozcrash.subprocess, 'Popen', MockPopen)
+