[Sugar-devel] Unit tests in Sugar HTML

Daniel Narvaez dwnarvaez at gmail.com
Mon May 13 20:03:44 EDT 2013


I'm not sure you can run webkitgtk headless. And we will need the sugar
shell running for apisocket to work (in the future I would like UI and
backend to be better decoupled, but that will require a lot of refactoring).

It should not be a prob though, we can run karma inside sugar, inside xvfb,
and set the browser command to sugar-html-activity.

On Monday, 13 May 2013, Manuel Quiñones wrote:

> We could run the tests in a custom WebKitGTK browser script, which
> could be like htmlactivity.py but without UI.
>
> http://karma-runner.github.io/0.8/config/browsers.html
>
> And add something like this in the karma.conf.js:
>
> browsers = ['/usr/local/bin/custom-browser.sh'];
>
>
> 2013/5/13 Manuel Quiñones <manuq at laptop.org <javascript:;>>:
> > 2013/5/13 Daniel Narvaez <dwnarvaez at gmail.com <javascript:;>>:
> >> I'm on a phone so I have not yet taken a proper look. Though it looks
> pretty
> >> cool. It seems to have custom browsers support, so it should be easy to
> run
> >> it in sugar-html-activity.
> >>
> >> We can look at hooking this up in sugar-build/buildbot, it should not
> be a
> >> lot of work.
> >>
> >> I suppose it should work for the libraries too if we just put some HTML
> in
> >> the test dir.
> >
> > Yes the idea is to add unit tests in each of our libraries.  I did it
> > in lib/sugar-html-graphics inside clockjs code to get a first
> > impression, but I will move it to sugar-html-graphics repository if we
> > agree using Jasmine.
> >
> > There is no need to add any HTML.  Just add a loader.js inside test/
> > with the RequireJS configuration, similar to the activity js/loader.js
> > .
> >
> > So the proposal would be:
> >
> > - start writting unit tests with Jasmine framework
> > - add a command to sugar-build to run the tests with Karma
> > - automate tests adding Karma to buildbot
> >
> > --
> > .. manuq ..
>
>
>
> --
> .. manuq ..
>


-- 
Daniel Narvaez
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20130514/8d19c45b/attachment.html>


More information about the Sugar-devel mailing list