Replace promiseWaitForCondition with TestUtils.waitForCondition in browser_aboutHome_search_searchbar.js

RESOLVED FIXED in Firefox 61

Status

()

P5
normal
RESOLVED FIXED
11 months ago
10 months ago

People

(Reporter: johannh, Assigned: is2ei, Mentored)

Tracking

({good-first-bug})

60 Branch
Firefox 61
good-first-bug
Points:
---

Firefox Tracking Flags

(firefox61 fixed)

Details

Attachments

(1 attachment)

(Reporter)

Description

11 months ago
This is a good first bug for newcomers to Firefox development.

promiseWaitForCondition in the browser_aboutHome_search_searchbar.js test file can be replaced by the TestUtils.waitForCondition[0] utility function. We can also remove the function definition in the head.js file.

The code in question is here: https://searchfox.org/mozilla-central/search?q=promisewaitforcondition&path=browser%2Fbase%2Fcontent%2Ftest%2Fabout

For instructions on how to get your local build of Firefox up and running and submit your patch, see https://developer.mozilla.org/en-US/docs/Introduction.

You can run this test with the ./mach mochitest command:

./mach mochitest browser/base/content/test/about/browser_aboutHome_search_searchbar.js

Please leave a comment if you would like to be assigned to this bug and feel free to ask questions here or via IRC if you're stuck.

[0] https://searchfox.org/mozilla-central/rev/efce4ceddfbe5fe4e2d74f1aed93894bada9b273/testing/modules/TestUtils.jsm#114

Comment 1

11 months ago
Hello I was referred to this bug. Can I tackle this problem ?
(Reporter)

Comment 2

11 months ago
Yup, thanks!
Assignee: nobody → kev.ftw595
Status: NEW → ASSIGNED
(Reporter)

Comment 3

11 months ago
Hi, are you still working on this? :)
Flags: needinfo?(kev.ftw595)
(Reporter)

Updated

10 months ago
Assignee: kev.ftw595 → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(kev.ftw595)
(Assignee)

Comment 4

10 months ago
Hi I'm Issei.
Could I work on this issue?
(Assignee)

Comment 5

10 months ago
Hi, Could I ask you a question?
I tried the testing command and got errors.

==================================
$ ./mach mochitest browser/base/content/test/about/browser_aboutHome_search_searchbar.js
cat: backend.TestManifestBackend.in: No such file or directory
Build configuration changed. Regenerating backend.
Traceback (most recent call last):
  File "/Users/horie/oss/mozilla/mozilla-unified/build/gen_test_backend.py", line 39, in <module>
    sys.exit(gen_test_backend())
  File "/Users/horie/oss/mozilla/mozilla-unified/build/gen_test_backend.py", line 35, in gen_test_backend
    backend.consume(data)
  File "/Users/horie/oss/mozilla/mozilla-unified/python/mozbuild/mozbuild/backend/base.py", line 126, in consume
    for obj in objs:
  File "/Users/horie/oss/mozilla/mozilla-unified/python/mozbuild/mozbuild/frontend/emitter.py", line 172, in emit
    for out in output:
  File "/Users/horie/oss/mozilla/mozilla-unified/python/mozbuild/mozbuild/frontend/reader.py", line 899, in read_topsrcdir
    for r in self.read_mozbuild(path, self.config):
  File "/Users/horie/oss/mozilla/mozilla-unified/python/mozbuild/mozbuild/frontend/reader.py", line 1073, in read_mozbuild
    sys.exc_info()[2], sandbox_load_error=sle)
mozbuild.frontend.reader.BuildReaderError: 
==============================
FATAL ERROR PROCESSING MOZBUILD FILE
==============================

The error occurred while processing the following file:

    /Users/horie/oss/mozilla-unified/moz.build

The underlying problem is we referenced a path that does not exist. That path is:

    /Users/horie/oss/mozilla-unified/moz.build

Either create the file if it needs to exist or do not reference it.

make: *** [backend.TestManifestBackend] Error 1
Error running mach:

    ['mochitest', 'browser/base/content/test/about/browser_aboutHome_search_searchbar.js']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.

You should consider filing a bug for this issue.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

Exception: Process executed with non-0 exit code 2: [u'/usr/bin/make', u'-f', u'/Users/horie/oss/mozilla/mozilla-unified/build/rebuild-backend.mk', u'-j8', u'-s', u'backend.TestManifestBackend']

  File "/Users/horie/oss/mozilla/mozilla-unified/testing/mochitest/mach_commands.py", line 353, in run_mochitest_general
    tests = mochitest.resolve_tests(test_paths, test_objects, cwd=self._mach_context.cwd)
  File "/Users/horie/oss/mozilla/mozilla-unified/testing/mochitest/mach_commands.py", line 104, in resolve_tests
    resolver = self._spawn(TestResolver)
  File "/Users/horie/oss/mozilla/mozilla-unified/python/mozbuild/mozbuild/base.py", line 741, in _spawn
    topobjdir=self.topobjdir)
  File "/Users/horie/oss/mozilla/mozilla-unified/testing/mozbase/moztest/moztest/resolve.py", line 401, in __init__
    self.topsrcdir, 'build', 'gen_test_backend.py'),
  File "/Users/horie/oss/mozilla/mozilla-unified/python/mozbuild/mozbuild/base.py", line 669, in _run_make
    return fn(**params)
  File "/Users/horie/oss/mozilla/mozilla-unified/python/mozbuild/mozbuild/base.py", line 724, in _run_command_in_objdir
    return self.run_process(cwd=self.topobjdir, **args)
  File "/Users/horie/oss/mozilla/mozilla-unified/python/mach/mach/mixin/process.py", line 153, in run_process
    raise Exception('Process executed with non-0 exit code %d: %s' % (status, args))
=============================

Is there any instruction I missed?
Flags: needinfo?(jhofmann)
(Reporter)

Comment 6

10 months ago
Sorry for the delay here, last week was pretty busy for me.

Hm, did you run

./mach bootstrap

and

./mach build

?

You can find more detailed build instructions here: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_build

Please make sure to follow them :)
Assignee: nobody → is2ei.horie
Status: NEW → ASSIGNED
Flags: needinfo?(jhofmann) → needinfo?(is2ei.horie)
(Assignee)

Comment 7

10 months ago
(In reply to Johann Hofmann [:johannh] - back on May 2nd from comment #6)
> Sorry for the delay here, last week was pretty busy for me.
> 
> Hm, did you run
> 
> ./mach bootstrap
> 
> and
> 
> ./mach build
> 
> ?
> 
> You can find more detailed build instructions here:
> https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/
> Build_Instructions/Simple_Firefox_build
> 
> Please make sure to follow them :)

Thanks!

I tried to build and got an error...
https://pastebin.mozilla.org/9084208

I'm asking how to solve it on #build and #introduction channels.
Could you help me if you found that kind of error before?
Flags: needinfo?(is2ei.horie) → needinfo?(jhofmann)
(Assignee)

Comment 8

10 months ago
The error has gone now.
I'll continue to work on this issue.
(Assignee)

Comment 9

10 months ago
Created attachment 8972198 [details] [diff] [review]
bug-1447941.patch

Thanks for your support!
I created a patch. Could you review it, please?
Attachment #8972198 - Flags: review?(jhofmann)
(Reporter)

Comment 10

10 months ago
Comment on attachment 8972198 [details] [diff] [review]
bug-1447941.patch

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

That looks great, thank you! I've given you the ability edit bugs now, so you can just set the checkin-needed flag on this one if you like to get it landed (in the "keywords" field).

We would usually do a try run (https://wiki.mozilla.org/ReleaseEngineering/TryServer) but I assume you ran the test locally so we don't have to waste precious energy on it :)

Thanks!
Attachment #8972198 - Flags: review?(jhofmann) → review+
(Reporter)

Updated

10 months ago
Flags: needinfo?(jhofmann)
(Assignee)

Comment 11

10 months ago
Thanks! I have marked this for checkin.
Keywords: checkin-needed

Comment 12

10 months ago
Pushed by ccoroiu@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/ba57284bc3bc
Replace promiseWaitForCondition with TestUtils.waitForCondition in browser_aboutHome_search_searchbar.js r=johannh
Keywords: checkin-needed

Comment 13

10 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/ba57284bc3bc
Status: ASSIGNED → RESOLVED
Last Resolved: 10 months ago
status-firefox61: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 61
You need to log in before you can comment on or make changes to this bug.