Closed Bug 899047 Opened 6 years ago Closed 6 years ago

Unable to run Robocop tests locally - the script is looking for binary under /dist/bin/fennec and should look under /dist/fennec


(Firefox for Android :: General, defect)

Not set



Firefox 25


(Reporter: AdrianT, Assigned: ahal)




(1 file, 1 obsolete file)

A recent change which I have not yet been able to identify has changed the /python/mozbuild/mozbuild/ script most likely and now it checks for binaries under objdir/dist/bin/fennec instead of objdir/dist/fennec. Making a copy of the fennec folder in objdir/bin solves the issue and I can run Robocop tests again. This is reproducible both when tunning the test using make-robocop and the runtestsremote script from the virtualenv.

raceback (most recent call last):
  File "_tests/testing/mochitest/", line 19, in <module>
    from runtests import Mochitest
  File "/home/adriantamas/mc/obj-android/_tests/testing/mochitest/", line 26, in <module>
    from mochitest_options import MochitestOptions
  File "/home/adriantamas/mc/obj-android/_tests/testing/mochitest/", line 23, in <module>
    class MochitestOptions(optparse.OptionParser):
  File "/home/adriantamas/mc/obj-android/_tests/testing/mochitest/", line 44, in MochitestOptions
    "default": build_obj.get_binary_path() if build_obj is not None else None,
  File "/home/adriantamas/mc/python/mozbuild/mozbuild/", line 279, in get_binary_path
    raise Exception('Binary expected at %s does not exist.' % path)
Exception: Binary expected at /home/adriantamas/mc/obj-android/dist/bin/fennec does not exist.
Blocks: 865349
Looks like mozbuild should detect if the objdir was built for fennec and update get_binary_path() accordingly?
It turns out that Fennec doesn't actually care about --appname at all, and bug 865349 basically broke the hack that was used to get around the fact that verifyOptions required it:

This patch moves the get_binary_path call into verify options which makes the hack work again. I don't have a fennec build handy, but I'm pretty sure this will make things work again. Would someone mind verifying?

I'll leave it up to ted or gps if they want to modify get_binary_path to work for fennec, though I don't think there is a pressing need for it.
Assignee: nobody → ahalberstadt
Attachment #783779 - Flags: review?(gbrown)
Helps to actually qref the patch in question..
Attachment #783779 - Attachment is obsolete: true
Attachment #783779 - Flags: review?(gbrown)
Attachment #783780 - Flags: review?(gbrown)
Comment on attachment 783780 [details] [diff] [review]
Patch 1.0 - call get_binary_path in verify options

Review of attachment 783780 [details] [diff] [review]:

With the one indentation problem corrected, this works fine for me.

::: testing/mochitest/
@@ +336,5 @@
>      def verifyOptions(self, options, mochitest):
>          """ verify correct options and cleanup paths """
> +       if is None:

The indent is off by 1 space here. That caused:

$ make mochitest-robocop
Traceback (most recent call last):
  File "_tests/testing/mochitest/", line 19, in <module>
    from runtests import Mochitest
  File "/home/mozdev/objdirs/x86/_tests/testing/mochitest/", line 25, in <module>
    from mochitest_options import MochitestOptions
  File "/home/mozdev/objdirs/x86/_tests/testing/mochitest/", line 344
    if is None:
IndentationError: unindent does not match any outer indentation level
make: *** [mochitest-robocop] Error 1
Attachment #783780 - Flags: review?(gbrown) → review+
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 25
You need to log in before you can comment on or make changes to this bug.