choroba has asked for the wisdom of the Perl Monks concerning the following question:

Venerable brethren and sestren,
I am trying to install MozRepl from CPAN, but many test are failing. I have Mozilla Firefox 10.0 (wow, they increment versions faster than Perl!) with MozRepl 1.1. Is there anyone having any experience or knowing a workaround? The first failure:
.------------+------------------------------------------. | type | content | +------------+------------------------------------------+ | command | repl.enter(window); | | result | [object ChromeWindow] - {window: {...},- | | | document: {...}, gPrintSettingsAreGlob- | | | al: false, gSavePrintSettings: false, g- | | | FocusedElement: null, PrintUtils: {...}- | | | , ZoomManager: {...}, ...} | '------------+------------------------------------------' # Failed test at t/10-plugin-repl-enter.t line 12. # got: '[object ChromeWindow] - {window: {...}, document: {.. +.}, gPrintSettingsAreGlobal: false, gSavePrintSettings: false, gFocus +edElement: null, PrintUtils: {...}, ZoomManager: {...}, ...}' # expected: '[object ChromeWindow]'
The last one ():
.------------+------------------------------------------. | type | content | +------------+------------------------------------------+ | command | JSONstring.make({ a: 1, b: 2 }); | | result | "{"a":1, | | | "b":2}" | '------------+------------------------------------------' # Failed test at t/20-plugin-json.t line 17. # got: '"{"a":1,"b":2}"' # expected: '{"a":1,"b":2}'
There are 8 more failures, most of them similar to the ones already mentioned, however the last three seem more serious (getting undef instead of something):
.------------+------------------------------------------. | type | content | +------------+------------------------------------------+ | command | repl.enter(document); | | result | [object XULDocument] - {location: {...}- | | | , querySelector: function() {...}, quer- | | | ySelectorAll: function() {...}, evaluat- | | | e: function() {...}, createExpression: - | | | function() {...}, createNSResolver: fun- | | | ction() {...}, addEventListener: functi- | | | on() {...}, ...} | '------------+------------------------------------------' # Failed test at t/10-plugin-repl-enter.t line 14. # got: '[object XULDocument] - {location: {...}, querySelecto +r: function() {...}, querySelectorAll: function() {...}, evaluate: fu +nction() {...}, createExpression: function() {...}, createNSResolver: + function() {...}, addEventListener: function() {...}, ...}' # expected: '[object XULDocument]' (...) .------------+------------------------------------------. | type | content | +------------+------------------------------------------+ | command | repl.home(); | | result | [object ChromeWindow] - {window: {...},- | | | document: {...}, gPrintSettingsAreGlob- | | | al: false, gSavePrintSettings: false, g- | | | FocusedElement: null, PrintUtils: {...}- | | | , ZoomManager: {...}, ...} | '------------+------------------------------------------' # Failed test at t/16-plugin-repl-home.t line 12. # got: '[object ChromeWindow] - {window: {...}, document: {.. +.}, gPrintSettingsAreGlobal: false, gSavePrintSettings: false, gFocus +edElement: null, PrintUtils: {...}, ZoomManager: {...}, ...}' # expected: '[object ChromeWindow]' (...) .------------+------------------------------------------. | type | content | +------------+------------------------------------------+ | command | repl.util.helpUrlFor(window.document.ge- | | | tElementsByTagName('window')[0]); | | result | "http://xulplanet.com/references/elemre- | | | f/ref_window.html" | '------------+------------------------------------------' # Failed test at t/18-plugin-repl-util-help_url_for.t line 16. # got: '"http://xulplanet.com/references/elemref/ref_window.h +tml"' # expected: 'http://xulplanet.com/references/elemref/ref_window.ht +ml' (...) .------------+------------------------------------------. | type | content | +------------+------------------------------------------+ | command | repl.util.helpUrlFor("@mozilla.org/netw- | | | ork/protocol;1?name=view-source"); | | result | "http://xulplanet.com/references/xpcomr- | | | ef/comps/c_networkprotocol1nameviewsour- | | | ce.html" | '------------+------------------------------------------' # Failed test at t/18-plugin-repl-util-help_url_for.t line 22. # got: '"http://xulplanet.com/references/xpcomref/comps/c_net +workprotocol1nameviewsource.html"' # expected: 'http://xulplanet.com/references/xpcomref/comps/c_netw +orkprotocol1nameviewsource.html' (...) .------------+------------------------------------------. | type | content | +------------+------------------------------------------+ | command | repl.util.helpUrlFor("@mozilla.org/supp- | | | orts-float;1"); | | result | "http://xulplanet.com/references/xpcomr- | | | ef/comps/c_supportsfloat1.html" | '------------+------------------------------------------' # Failed test at t/18-plugin-repl-util-help_url_for.t line 29. # got: '"http://xulplanet.com/references/xpcomref/comps/c_sup +portsfloat1.html"' # expected: 'http://xulplanet.com/references/xpcomref/comps/c_supp +ortsfloat1.html' (...) .------------+------------------------------------------. | type | content | +------------+------------------------------------------+ | command | repl.util.docFor(window); | | result | "TYPE: object | | | " | '------------+------------------------------------------' # Failed test at t/19-plugin-repl-util-doc_for.t line 16. # got: undef # expected: 'object' (...) .------------+------------------------------------------. | type | content | +------------+------------------------------------------+ | command | repl.util.docFor(window.document); | | result | "TYPE: object | | | NODENAME: #document | | | " | '------------+------------------------------------------' # Failed test at t/19-plugin-repl-util-doc_for.t line 20. # got: undef # expected: 'object' (...) .------------+------------------------------------------. | type | content | +------------+------------------------------------------+ | command | repl.util.docFor(repl.inspect); | | result | "TYPE: function | | | NAME: inspect | | | ARGS: obj, maxDepth, name, curDepth | | | | | | Lists members of a given object. | | | " | '------------+------------------------------------------' # Failed test at t/19-plugin-repl-util-doc_for.t line 27. # got: undef # expected: 'function'

Replies are listed 'Best First'.
Re: Failing Tests in MozRepl
by Corion (Patriarch) on Feb 11, 2012 at 09:01 UTC

    I think the last three failures are less tough, as they try to fetch documentation from an URL that has changed since the release of MozRepl. I don't know why there are additional (bad) quotes in the first tests though. Do you know what versions of the mozrepl plugin, MozRepl and Firefox you are running this with?

      CPAN tries to install MozRepl 0.06, the rest is already mentioned at the beginning of the OP. I am running openSUSE 12.1.

        I can replicate these failures under Windows XP using Firefox 10.0.1 as well. It seems that Mozilla broke backwards compatibility there. If you only care about using WWW::Mechanize::Firefox, you should be able to force-install MozRepl, as MozRepl::RemoteObject uses a different method of transferring (resp. delimiting) data. At least, the test suite for both modules still pass even though the test suite for MozRepl fails.

        Update: It seems that most (but only) MozRepl plugins are affected, like the JSON plug-in. I haven't looked at what could be the cause though.

Re: Failing Tests in MozRepl
by davido (Cardinal) on Feb 11, 2012 at 17:29 UTC

    This could be related to RT#64713: can not pass tests.

    If you can get Toru Yamaguchi to reply to a friendly email on the subject, and if it seems like it wouldn't be too difficult to fix, you might be able to submit a patch to him and get it applied. If that fails, you could patch it and push it to a public Github repo and ask him again nicely if you might take on co-maintainership so that you can patch it. And if that fails to get a response, you could contact the PAUSE folks and ask to be assigned co-maintainership so that you might patch it.

    ...or maybe try to enlist corion's assistance since he has an interest in this module. Ideally Toru will handle it once contacted, but there are alternatives that can still benefit CPAN users even if he is MIA. I've got one such project underway at the moment. It's been rewarding as a learning experience for me.


    Dave

Re: Failing Tests in MozRepl
by bbrown25 (Initiate) on Jun 23, 2014 at 18:01 UTC
    Hi all. It seems I am having the same issue. Firefox 30, Mac OSX 10.9.3, MozRepl 1.1.2. I have to --force MozRepl and MozRepl::RemoteObject MozRepl module fails with
    Test Summary Report ------------------- t/10-plugin-repl-enter.t (Wstat: 512 Tests: 3 Failed: 2) Failed tests: 2-3 Non-zero exit status: 2 t/16-plugin-repl-home.t (Wstat: 256 Tests: 2 Failed: 1) Failed test: 2 Non-zero exit status: 1 t/18-plugin-repl-util-help_url_for.t (Wstat: 768 Tests: 4 Failed: 3) Failed tests: 2-4 Non-zero exit status: 3 t/19-plugin-repl-util-doc_for.t (Wstat: 768 Tests: 7 Failed: 3) Failed tests: 2-3, 5 Non-zero exit status: 3 t/20-plugin-json.t (Wstat: 256 Tests: 2 Failed: 1) Failed test: 2 Non-zero exit status: 1 Files=14, Tests=58, 2 wallclock secs ( 0.08 usr 0.04 sys + 2.16 cus +r 0.22 csys = 2.50 CPU) Result: FAIL Failed 5/14 test programs. 10/58 subtests failed. make: *** [test_dynamic] Error 255
    and RemoteObject failures:
    Test Summary Report ------------------- t/01-callback.t (Wstat: 1024 Tests: 15 Failed: 4) Failed tests: 11-14 Non-zero exit status: 4 t/01-expr.t (Wstat: 256 Tests: 9 Failed: 1) Failed test: 2 Non-zero exit status: 1 Files=34, Tests=186, 85 wallclock secs ( 0.15 usr 0.06 sys + 17.89 cu +sr 1.05 csys = 19.15 CPU) Result: FAIL Failed 2/34 test programs. 5/186 subtests failed. make: *** [test_dynamic] Error 255
    and then WWW::Mechanize::Firefox fails as well, even after the above 2 are forced:
    Test Summary Report ------------------- t/49-mech-nav.t (Wstat: 5632 Tests: 0 Failed: 0) Non-zero exit status: 22 Parse errors: Bad plan. You planned 3 tests but ran 0. t/50-tick.t (Wstat: 4608 Tests: 19 Failed: 18) Failed tests: 2-19 Non-zero exit status: 18 t/51-click_button.t (Wstat: 5632 Tests: 0 Failed: 0) Non-zero exit status: 22 Parse errors: Bad plan. You planned 22 tests but ran 0. t/60-mech-custom-headers.t (Wstat: 5632 Tests: 5 Failed: 1) Failed test: 5 Non-zero exit status: 22 Parse errors: Bad plan. You planned 21 tests but ran 5. t/70-download-url.t (Wstat: 5632 Tests: 2 Failed: 0) Non-zero exit status: 22 Parse errors: Bad plan. You planned 5 tests but ran 2. t/70-real-status.t (Wstat: 256 Tests: 11 Failed: 1) Failed test: 11 Non-zero exit status: 1 Files=86, Tests=807, 435 wallclock secs ( 0.49 usr 0.18 sys + 55.53 c +usr 3.45 csys = 59.65 CPU) Result: FAIL Failed 6/86 test programs. 20/807 subtests failed.
    Not sure I'm confident enough to find and modify all the tests necessary to make them pass. Should I force W::M::F as well? much thanks in advance.

      I seem to be getting the same errors on Solaris. And funny - I want to use W::M::F as well *and* don't feel optimistic about forcing this. Code hasn't been touched since 2007.

      Actually to make the test pass in 20-plugin-json.t I just added double quotes in this line (my diffs):

      diff 20-plugin-json.t ../../MozRepl-0.06-882RqE/t/20-plugin-json.t 17c17 < is($repl->json({ source => MozRepl::Util->javascript_value({a => + 1, b => 2})}), q|"{"a":1,"b":2}"|); --- > is($repl->json({ source => MozRepl::Util->javascript_value({a => + 1, b => 2})}), q|{"a":1,"b":2}|);

      But I have no idea if this makes sense. This more 'it hurts when I do that - so I am not doing that!'

        MozRepl has been failing its tests for a long time already. I would force the installation.