Closed Bug 829664 Opened 11 years ago Closed 11 years ago

`make check` fails on mozbuild/test/test_mozconfig.py with MOZCONFIG set

Categories

(Firefox Build System :: General, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla21

People

(Reporter: k0scist, Assigned: k0scist)

Details

Attachments

(1 file)

TEST-UNEXPECTED-FAIL | /home/jhammel/mozilla/src/mozilla-central/python/mozbuild/mozbuild/test/test_mozconfig.py | line 148, test_read_no_mozconfig: {u'topobjdir': u'/tmp/tmp69WgvG/../obj-browser', u'make_flags': [], u'env': {u'u [truncated]... != {u'topobjdir': None, u'make_flags': None, u'env': None, u'path': None, u'make_ex [truncated]...
Diff is 3892 characters long. Set self.maxDiff to None to see it.

I have the MOZCONFIG environment variable set:

MOZCONFIG=/home/jhammel/mozilla/mozconfigs/mozconfig

If I unset this, the test works fine.  The test should unset the variable to ensure it passes
Actually there are a few more failures:

TEST-UNEXPECTED-FAIL | /home/jhammel/mozilla/src/mozilla-central/python/mozbuild/mozbuild/test/test_mozconfig.py | line 89, test_find_default_files: '/home/jhammel/mozilla/mozconfigs/mozconfig' != u'/tmp/tmp35oud4/.mozconfig'
TEST-UNEXPECTED-FAIL | /home/jhammel/mozilla/src/mozilla-central/python/mozbuild/mozbuild/test/test_mozconfig.py | line 132, test_find_deprecated_home_paths: MozconfigFindException not raised
TEST-UNEXPECTED-FAIL | /home/jhammel/mozilla/src/mozilla-central/python/mozbuild/mozbuild/test/test_mozconfig.py | line 114, test_find_deprecated_path_srcdir: MozconfigFindException not raised
TEST-PASS | /home/jhammel/mozilla/src/mozilla-central/python/mozbuild/mozbuild/test/test_mozconfig.py | test_find_legacy_env
TEST-UNEXPECTED-FAIL | /home/jhammel/mozilla/src/mozilla-central/python/mozbuild/mozbuild/test/test_mozconfig.py | line 101, test_find_multiple_defaults: MozconfigFindException not raised
Attachment #701183 - Flags: review?(gps)
Comment on attachment 701183 [details] [diff] [review]
pop the MOZCONFIG environment variable

Review of attachment 701183 [details] [diff] [review]:
-----------------------------------------------------------------

I love simple patches!

::: python/mozbuild/mozbuild/test/test_mozconfig.py
@@ +27,5 @@
>  
>  class TestMozconfigLoader(unittest.TestCase):
>      def setUp(self):
>          self._old_env = dict(os.environ)
> +        self._mozconfig = os.environ.pop('MOZCONFIG', None)

Since you don't do anything with self._mozconfig, I'd just not store it.
Attachment #701183 - Flags: review?(gps) → review+
> Since you don't do anything with self._mozconfig, I'd just not store it.

Good call. I was intended to set it back but then realized that the old environment was already restored so I didn't need to; Will fix on checkin
https://hg.mozilla.org/mozilla-central/rev/15d99c7eb660
Assignee: nobody → jhammel
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: