You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Gert-Jan Braas <br...@steckelfisch.nl> on 2014/02/18 16:56:33 UTC

Introducing

Hello,

I'd like to introduce myself.
My name is Gert-Jan Braas and since a few months I'm focussing on 
Cordova and FirefoxOS.
My previous coding experience comprises java,  a bit of python and 
various scripting languages.
I still need to get my Javascript up to speed, but 'm working on that.

As i'm still figuring out 'how stuff works' I would like to focus on the 
building proces,
documentation and simple issues.



Already I have some pull-requestst field on github 
(apache/cordova-firefoxos, apache/cordova-plugman),
and I would like to know how to get them reviewed and accepted.



Regards,
Gert-Jan Braas



Re: plugman testing

Posted by Piotr Zalewa <pz...@mozilla.com>.
Please also jump onto #apps or #cordova at irc.mozilla.com if you wish 
to talk to Mozilla team working on Cordova integration.


On 02/19/2014 06:18 PM, Steven Gill wrote:
> Do it!
> On Feb 19, 2014 3:27 AM, "Gert-Jan Braas" <br...@steckelfisch.nl> wrote:
>
>> I noticed there are no unit test for firefoxos yet.
>>
>> Is anybody working on that?
>>
>> Mayebe thats a nice thing to pick up for me.
>>
>> Gert-Jan Braas
>>
>> --
>> ====================
>> U ademt. Dat hebben wij gepatenteerd.
>> Mogen we even vangen?
>> -------------------------------------
>> Klaar met die sociale onzin? Installeer Ghostery: http://www.ghostery.com/
>> Of mooier nog: http://suicidemachine.org/
>>
>


-- 
Piotr Zalewa
Mozilla

RE: plugman testing

Posted by Gert-Jan Braas <br...@steckelfisch.nl>.
ah...
          <config-file target="config.xml" parent="/*">
saved the day. The test now completes. Hope it is the corect setting for 
Firefoxos.

Could anyone explain to me where the exception went before I catched it?



Gert-Jan Braas schreef op 2014-02-27 22:31:
> Found it. Was because of my own doing.
> 
> I altered spec/plugins/DummyPlugin/plugin.xml with:
> 
>     <!-- firefoxos -->
>     <platform name="firefoxos">
>         <config-file target="config.xml" parent="/">
>             <feature id="dummyPlugin" required="true" 
> version="1.0.0.0"/>
>         </config-file>
> 
>         <source-file src="src/firefoxos/DummyPlugin.js"
>                    target-dir="src/plugins/dummyplugin" />
>         <js-module src="www/dummyplugin.js" name="Dummy">
>             <clobbers target="dummy" />
>         </js-module>
>     </platform>
> 
> in config_changer PlatformMunger stumbels with the message
> 
> PlatformMunger_process. error: grafting xml at selector "/" from
> "/home/braas/tmp/plugman/config.xml" during config install went bad :(
> 
> while preparing a queue.
> 
> The excpetion was lost or eaten somewhere.
> 
> Clearly I have the wrong setup for the test.
> What doe 'parent' mean?
> What should be the correct xml for firefoxos in DummyPlugin/plugin.xml?
> and
> Where can I find documentation on how to craft the pluin.xml's in the
> other plugins-dirs (or should that follow from the correct version of
> the XML above?)
> 

-- 
====================
U ademt. Dat hebben wij gepatenteerd.
Mogen we even vangen?
-------------------------------------


RE: plugman testing

Posted by Gert-Jan Braas <br...@steckelfisch.nl>.
Found it. Was because of my own doing.

I altered spec/plugins/DummyPlugin/plugin.xml with:

     <!-- firefoxos -->
     <platform name="firefoxos">
         <config-file target="config.xml" parent="/">
             <feature id="dummyPlugin" required="true" 
version="1.0.0.0"/>
         </config-file>

         <source-file src="src/firefoxos/DummyPlugin.js"
                    target-dir="src/plugins/dummyplugin" />
         <js-module src="www/dummyplugin.js" name="Dummy">
             <clobbers target="dummy" />
         </js-module>
     </platform>

in config_changer PlatformMunger stumbels with the message

PlatformMunger_process. error: grafting xml at selector "/" from 
"/home/braas/tmp/plugman/config.xml" during config install went bad :(

while preparing a queue.

The excpetion was lost or eaten somewhere.

Clearly I have the wrong setup for the test.
What doe 'parent' mean?
What should be the correct xml for firefoxos in DummyPlugin/plugin.xml?
and
Where can I find documentation on how to craft the pluin.xml's in the
other plugins-dirs (or should that follow from the correct version of 
the XML above?)

Gert-Jan Braas



Jonathan Bond-Caron schreef op 2014-02-26 15:48:
> On Wed Feb 26 09:24 AM, Gert-Jan Braas wrote:
> 
>> >>                      expect(s).toHaveBeenCalledWith(temp,
>> >> path.join('src', 'plugins', 'dummyplugin', 'DummyPlugin.js'));
>> >>                      done();
>> >>                   });
>> >>              });
>> >>          });
>> >>
>> >
>> > Jasmine runs synchronously, so you need to 'waitsFor' promise:
>> >
>> 
>> Ok thanks.
>> Will look that up. First I will try to look what's going on thoug. The 
>> 'waitFor' is not
>> needed in the tests for the other platforms, so I don't expect it to 
>> be for
>> Firefoxos also. Correct me if I'm wrong.
>> 
> 
> So I take that back,
> 
> Looks like jasmine supports calling done() to wait for an async test
> (documented in 2.0).
> 
> Seems like the better way to go.

-- 
====================
U ademt. Dat hebben wij gepatenteerd.
Mogen we even vangen?
-------------------------------------


RE: plugman testing

Posted by Jonathan Bond-Caron <jb...@gdesolutions.com>.
On Wed Feb 26 09:24 AM, Gert-Jan Braas wrote:

> >>                      expect(s).toHaveBeenCalledWith(temp,
> >> path.join('src', 'plugins', 'dummyplugin', 'DummyPlugin.js'));
> >>                      done();
> >>                   });
> >>              });
> >>          });
> >>
> >
> > Jasmine runs synchronously, so you need to 'waitsFor' promise:
> >
> 
> Ok thanks.
> Will look that up. First I will try to look what's going on thoug. The 'waitFor' is not
> needed in the tests for the other platforms, so I don't expect it to be for
> Firefoxos also. Correct me if I'm wrong.
> 

So I take that back,
 
Looks like jasmine supports calling done() to wait for an async test (documented in 2.0). 

Seems like the better way to go.



RE: plugman testing

Posted by Gert-Jan Braas <br...@steckelfisch.nl>.
Jonathan Bond-Caron schreef op 2014-02-25 21:33:
> On Tue Feb 25 03:24 AM, Gert-Jan Braas wrote:
>> I've added some testing for firefoxos in plugman, but am a bit stuck 
>> on
>> the
>> uninstall handler.
>> 
>> test:
>>          describe('of <source-file> elements', function() {
>>              it('should remove stuff by calling common.removeFile',
>> function(done) {
>>                  var s = spyOn(common, 'removeFile');
>> 
>>                  install('firefoxos', temp, dummyplugin, plugins_dir, 
>> {})
>>                  .then(function() {
>>                      var source = copyArray(valid_source);
>>                      firefoxos['source-file'].uninstall(source[0], 
>> temp);
>>                      expect(s).toHaveBeenCalledWith(temp,
>> path.join('src', 'plugins', 'dummyplugin', 'DummyPlugin.js'));
>>                      done();
>>                   });
>>              });
>>          });
>> 
> 
> Jasmine runs synchronously, so you need to 'waitsFor' promise:
> 
...
> 
> This example might help:
> https://github.com/jbondc/cordova-plugman/blob/master/spec/install.spec.js#L115

Ok thanks.
Will look that up. First I will try to look what's going on thoug. The 
'waitFor' is not needed in
the tests for the other platforms, so I don't expect it to be for 
Firefoxos also. Correct me if I'm wrong.



-- 
====================
U ademt. Dat hebben wij gepatenteerd.
Mogen we even vangen?
-------------------------------------
Klaar met die sociale onzin? Installeer Ghostery: 
http://www.ghostery.com/
Of mooier nog: http://suicidemachine.org/

RE: plugman testing

Posted by Jonathan Bond-Caron <jb...@gdesolutions.com>.
On Tue Feb 25 03:24 AM, Gert-Jan Braas wrote:
> I've added some testing for firefoxos in plugman, but am a bit stuck on
> the
> uninstall handler.
> 
> test:
>          describe('of <source-file> elements', function() {
>              it('should remove stuff by calling common.removeFile',
> function(done) {
>                  var s = spyOn(common, 'removeFile');
> 
>                  install('firefoxos', temp, dummyplugin, plugins_dir, {})
>                  .then(function() {
>                      var source = copyArray(valid_source);
>                      firefoxos['source-file'].uninstall(source[0], temp);
>                      expect(s).toHaveBeenCalledWith(temp,
> path.join('src', 'plugins', 'dummyplugin', 'DummyPlugin.js'));
>                      done();
>                   });
>              });
>          });
> 

Jasmine runs synchronously, so you need to 'waitsFor' promise:

            runs(function() {
                setDonePromise( install('firefoxos', temp, dummyplugin, plugins_dir, {})  )
            });
            waitsFor(function() { return done; }, 'install promise never resolved', 200);
            runs(function() {
	var source = copyArray(valid_source);
	 firefoxos['source-file'].uninstall(source[0], temp);
	expect(s).toHaveBeenCalledWith(temp,path.join('src', 'plugins', 'dummyplugin', 'DummyPlugin.js'));            
            });

This example might help:
https://github.com/jbondc/cordova-plugman/blob/master/spec/install.spec.js#L115

>   - how is e.g.
>       require('../plugman').emit('verbose', 'Install complete for ' +
> plugin_id + ' on ' + platform + '.');
>     controled? can i set the emit level and where can i find it's output?


It's a wrapper for node's event emitter:
https://github.com/apache/cordova-plugman/blob/master/src/events.js
https://github.com/jbondc/cordova-plugman/blob/master/plugman.js#L58

By itself it doesn't "log" anything, just tracks events. You to map events to console.log()

An example here:
https://github.com/jbondc/cordova-plugman/blob/master/spec/common.js

cd spec
node-jasmine test.spec.js -d verbose

> Can it be used running tests (npm test)?

Would be nice, npm parses the commands on its own so doesn’t delegate any flags etc.. related to:
https://github.com/npm/npm/issues/3494


Re: plugman testing

Posted by Gert-Jan Braas <br...@steckelfisch.nl>.
I've added some testing for firefoxos in plugman, but am a bit stuck on 
the uninstall handler.

test:
         describe('of <source-file> elements', function() {
             it('should remove stuff by calling common.removeFile', 
function(done) {
                 var s = spyOn(common, 'removeFile');

                 install('firefoxos', temp, dummyplugin, plugins_dir, {})
                 .then(function() {
                     var source = copyArray(valid_source);
                     firefoxos['source-file'].uninstall(source[0], temp);
                     expect(s).toHaveBeenCalledWith(temp, 
path.join('src', 'plugins', 'dummyplugin', 'DummyPlugin.js'));
                     done();
                  });
             });
         });


result:

   1) firefoxos project handler uninstallation of <source-file> elements 
should remove stuff by calling common.removeFile
    Message:
      timeout: timed out after 5000 msec waiting for spec to complete
    Stacktrace:
      undefined

The install never completes. (the 'then' part is never reached)

What is the way to go here? commit the test, and leave fixin it to the 
'code owner'? Or are only non-failing tests allowed?

I'd rather fix it myself, and did give it a try, but got a bit lost in 
the install module.
so, some questions:
  - how is e.g.
      require('../plugman').emit('verbose', 'Install complete for ' + 
plugin_id + ' on ' + platform + '.');
    controled? can i set the emit level and where can i find it's output? 
Can it be used running tests (npm test)?
  - is there a howto on using the nodejs debugger in npm


Gert-Jan Braas


Steven Gill schreef op 2014-02-19 18:18:
> Do it!
> On Feb 19, 2014 3:27 AM, "Gert-Jan Braas" <br...@steckelfisch.nl> 
> wrote:
> 
>> I noticed there are no unit test for firefoxos yet.
>> 
>> Is anybody working on that?
>> 
>> Mayebe thats a nice thing to pick up for me.
>> 
>> Gert-Jan Braas
>> 
>> --
>> ====================
>> U ademt. Dat hebben wij gepatenteerd.
>> Mogen we even vangen?
>> -------------------------------------
>> Klaar met die sociale onzin? Installeer Ghostery: 
>> http://www.ghostery.com/
>> Of mooier nog: http://suicidemachine.org/
>> 

-- 
====================
U ademt. Dat hebben wij gepatenteerd.
Mogen we even vangen?
-------------------------------------
Klaar met die sociale onzin? Installeer Ghostery: 
http://www.ghostery.com/
Of mooier nog: http://suicidemachine.org/

Re: plugman testing

Posted by Gert-Jan Braas <br...@steckelfisch.nl>.
Hi,

Created a pull-reqeust on github
for: PB-6134 Add unit testing for Firefoxos in plugman



Could somebody please review and pull

https://github.com/apache/cordova-plugman/pull/59

or tel me what (and how) to improve.

Gert-Jan Braas


-- 
====================
U ademt. Dat hebben wij gepatenteerd.
Mogen we even vangen?
-------------------------------------


Re: plugman testing

Posted by Steven Gill <st...@gmail.com>.
Do it!
On Feb 19, 2014 3:27 AM, "Gert-Jan Braas" <br...@steckelfisch.nl> wrote:

> I noticed there are no unit test for firefoxos yet.
>
> Is anybody working on that?
>
> Mayebe thats a nice thing to pick up for me.
>
> Gert-Jan Braas
>
> --
> ====================
> U ademt. Dat hebben wij gepatenteerd.
> Mogen we even vangen?
> -------------------------------------
> Klaar met die sociale onzin? Installeer Ghostery: http://www.ghostery.com/
> Of mooier nog: http://suicidemachine.org/
>

plugman testing

Posted by Gert-Jan Braas <br...@steckelfisch.nl>.
I noticed there are no unit test for firefoxos yet.

Is anybody working on that?

Mayebe thats a nice thing to pick up for me.

Gert-Jan Braas

-- 
====================
U ademt. Dat hebben wij gepatenteerd.
Mogen we even vangen?
-------------------------------------
Klaar met die sociale onzin? Installeer Ghostery: 
http://www.ghostery.com/
Of mooier nog: http://suicidemachine.org/

Re: Introducing

Posted by Gert-Jan Braas <br...@steckelfisch.nl>.
>> Already I have some pull-requestst field on github
>> (apache/cordova-firefoxos, apache/cordova-plugman),
>> and I would like to know how to get them reviewed and accepted.
>> 
> 
> Currently, we do not get notified of pull requests on this mailing 
> list.
>  If it isn't on this list, or filed in a ticket on JIRA (which people 
> are
> watching), it really common to just slip through the cracks for a 
> while.
>  Recently one of our contributors created an amazing tool for scanning
> github pull requests, but its still a manual process.

OK.

cordova-firefoxos:
First CB-5816
https://github.com/apache/cordova-firefoxos/pull/7

and then CB-5751
https://github.com/apache/cordova-firefoxos/pull/6
(untested as  I have no windows, but it is a rather simple patch)

Number 6 depends on number 7. I created the pull requests in the wrong 
order.

cordova-plugman:
CB-5996
https://github.com/apache/cordova-plugman/pull/47
I created this issue myself.






> 
> If you are having trouble finding eyeballs for patches you have 
> written,
> just post a link to it on this mailing list or the corresponding JIRA
> ticket.  If that still doesn't work, poke the people who usually work 
> in
> that area directly.
> 
> 
>> 
>> 
>> 
>> Regards,
>> Gert-Jan Braas
> 
> 
> Cheers.
> -Michal

-- 
====================
U ademt. Dat hebben wij gepatenteerd.
Mogen we even vangen?
-------------------------------------
Klaar met die sociale onzin? Installeer Ghostery: 
http://www.ghostery.com/
Of mooier nog: http://suicidemachine.org/

Re: Introducing

Posted by Michal Mocny <mm...@chromium.org>.
On Tue, Feb 18, 2014 at 10:56 AM, Gert-Jan Braas <br...@steckelfisch.nl>wrote:

> Hello,
>
Hi!


>
> I'd like to introduce myself.
> My name is Gert-Jan Braas and since a few months I'm focussing on Cordova
> and FirefoxOS.
> My previous coding experience comprises java,  a bit of python and various
> scripting languages.
> I still need to get my Javascript up to speed, but 'm working on that.
>
> As i'm still figuring out 'how stuff works' I would like to focus on the
> building proces,
> documentation and simple issues.
>
Awesome, thanks for jumping in!


>
>
>
> Already I have some pull-requestst field on github
> (apache/cordova-firefoxos, apache/cordova-plugman),
> and I would like to know how to get them reviewed and accepted.
>

Currently, we do not get notified of pull requests on this mailing list.
 If it isn't on this list, or filed in a ticket on JIRA (which people are
watching), it really common to just slip through the cracks for a while.
 Recently one of our contributors created an amazing tool for scanning
github pull requests, but its still a manual process.

If you are having trouble finding eyeballs for patches you have written,
just post a link to it on this mailing list or the corresponding JIRA
ticket.  If that still doesn't work, poke the people who usually work in
that area directly.


>
>
>
> Regards,
> Gert-Jan Braas


Cheers.
-Michal