Closed Bug 909522 Opened 9 years ago Closed 9 years ago

Run mach's Python unit tests


(Firefox Build System :: General, defect)

Not set


(Not tracked)



(Reporter: gps, Assigned: gps)


(Blocks 1 open bug)


(Whiteboard: [mach])


(1 file)

mach has Python unit tests. They are currently disabled. I would like to enable them. I think some of the Python tests currently fail. This bug entails getting everything passing first, obviously.
Whiteboard: [mach]
Depends on: 957856
Blocks: 958196
We've held off doing this for too long. mach is too important to not
have its unit tests running on checkin. is not enabled because the test fails. This is
tracked by bug 958196. I don't believe anything mission critical relies
on entry points, so this shouldn't be a big deal.
Attachment #8357913 - Flags: review?(mshal)
Assignee: nobody → gps
Comment on attachment 8357913 [details] [diff] [review]
Run mach's unit tests as part of make check

>diff --git a/python/mach/mach/test/ b/python/mach/mach/test/
>--- a/python/mach/mach/test/
>+++ b/python/mach/mach/test/
>+# Not enabled in automation because tests are failing.
>+#if __name__ == '__main__':
>+#    main()

Couldn't hurt to mention bug 958196 in this comment too.

I applied bug 957856 before this patch, but when running make check I get:

ERROR: test_command_error (__main__.TestErrorOutput)
Traceback (most recent call last):
  File "/home/marf/mozilla-central-git/python/mach/mach/test/", line 23, in test_command_error
    'Command Error'])
  File "/home/marf/mozilla-central-git/python/mach/mach/test/", line 19, in _run_mach
    return TestBase._run_mach(self, args, '')
  File "/home/marf/mozilla-central-git/python/mach/mach/test/", line 25, in _run_mach
    m.load_commands_from_file(os.path.join(self.provider_dir, provider_file))
  File "/home/marf/mozilla-central-git/python/mach/mach/", line 235, in load_commands_from_file
    imp.load_source(module_name, path)
  File "/home/marf/mozilla-central-git/python/mach/mach/test/providers/", line 15, in <module>
    from mach.test.providers import throw2
ImportError: No module named providers

Is there another bug this is dependent on? Or are we still missing something from upstream mach?
The "ImportError: No module named providers" should have been fixed by the addition of the empty file in this patch. should be a more accurate try.
The try push was completely green.
Comment on attachment 8357913 [details] [diff] [review]
Run mach's unit tests as part of make check

Ahh, so it seems 'patch' just ignores new empty files (and diff -Naur doesn't generate a patch for them). git bz apply failed because I didn't have 957856 yet, and then I just tried to manually apply the patch it left around afterward. Sorry about that!
Attachment #8357913 - Flags: review?(mshal) → review+

mach is now POTB!
Flags: in-testsuite+
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.