[Sugar-devel] Getting karma to work with sugar-activity-html

Manuel Quiñones manuq at laptop.org
Tue May 21 11:03:00 EDT 2013


2013/5/20 Manuel Quiñones <manuq at laptop.org>:
> 2013/5/20 Daniel Narvaez <dwnarvaez at gmail.com>:
>> Accidentally sent the previous email. Sorry.
>>
>> New module with the test activity, I can transfer to sugarlabs if we agree
>> on the approach. I'm pretty happy with it, it doesn't even require to touch
>> toolkit.
>>
>> https://github.com/dnarvaez/sugar-html-test
>
> Excellent!  So you have the executable in it, and you added a new --uri, great.

Feel free to move sugar-html-test to sugarlabs user.

>> sugar-launch improvements
>>
>> https://github.com/sugarlabs/sugar/pull/68
>
> And you did some improvements in the go, great!  I'll test and merge
> accordingly.
>
>> sugar environment variables for html tests
>>
>> https://github.com/sugarlabs/sugar/pull/69
>>
>> sugar-runner changes to use SUGAR_RUN_TEST
>>
>> https://github.com/sugarlabs/sugar-runner/tree/karma
>>
>> sugar-build changes, use SUGAR_RUN_TEST and run-karma command
>>
>> https://github.com/sugarlabs/sugar-build/tree/karma

I checked out the karma branch, and got it working doing the change in
karma.conf.js:

browsers = ['sugar-html-test'];

Then I did:

$run-karma sugar-html-graphics/test/karma.conf.js

Sugar started, the test activity opened, and after that I saw the
karma output in shell.log

1369146597.616569 WARNING root: _Account.__set_current_activity_cb
ESC[32mINFO [Chrome 25.0 (Linux)]: ESC[39mConnected on socket id
n0CaTfj6LmRWe4SUfxN-
Chrome 25.0 (Linux): Executed 1 of 2
ESC[1AESC[2KChrome 25.0 (Linux): Executed 2 of 2
ESC[1AESC[2KChrome 25.0 (Linux): Executed 2 of 2ESC[32m SUCCESSESC[39m
(0.517 secs / 0.01 secs)
1369146636.664850 DEBUG root: new zoom level: 2

Great!  I think we could improve that output moving it to a separate
log file, and also setting colors to false in the karma conf file
like:

// enable / disable colors in the output (reporters and logs)
colors = false;

There are other configurations we could play with:

// test results reporter to use
// possible values: 'dots', 'progress', 'junit'
reporters = ['progress'];

// enable / disable watching file and executing tests whenever any file changes
autoWatch = true;

// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun = false;


I think we should leave the current settings because is good to
develop using karma interactively.  It watches the js files for
changes and re-runs.  They can instead be overriden adding parameters
to the "karma start" command.

Minor: I got a non miningful message trying to run it without
parameters (bash syntax error):

[sugar-build sugar-build]$ ./osbuild run-karma
  File "/home/manuq/prog/sugar-build/build/commands/run-karma", line 2
    SUGAR_RUN_TEST="karma start $@" sugar-runner
                                        ^
SyntaxError: invalid syntax

>>
>>
>> I put these together pretty quickly so there might be issues :) That aside,
>> we still need to setup sugar-build so that it runs tests automatically for
>> sugar-html-graphics, but that should be trivial on the top of this.
>>
>> _______________________________________________
>> Sugar-devel mailing list
>> Sugar-devel at lists.sugarlabs.org
>> http://lists.sugarlabs.org/listinfo/sugar-devel
>>
>
>
>
> --
> .. manuq ..



--
.. manuq ..


More information about the Sugar-devel mailing list