[dojo-contributors] unit test improvements

Andrew Wilson andrew at humanized.com
Wed Dec 6 17:11:09 EST 2006


Carla:

I never got an email answer to this question. I did, however, get the
glimmerings of an answer in last week's contributors meeting.

It would seem Dojo's unit tests are driven entirely by the Java/Ant build
process. They are, if I understand correctly, actually unit tests of the
code, and do not actually require a browser. They can run, for example, in
Rhino...which is exactly how they are run at present.

Selenium was briefly discussed; there was much support for the idea, but at
least one person made the point that he wanted to see the current tests run
on a regular basis in actual browsers before adding any more tests for
higher-level constructs.

Short answer: no, Selenium is not currently used, nor is there any
equivalent high-level test suite for the browser widgets. There is a general
desire to do it, but without any specific plans for it. There is also a
desire to create a test-process that runs the current low-level tests in
browser's JS engines.

-- Andrew

On 12/6/06, Carla Mott <Carla.Mott at sun.com> wrote:
>
> Hi Andrew,
>
> I think I missed the answer to this question. Can you forward as I'm
> interested figuring this out too.  I see that there is a framework
> and a page which has some info about it but nothing about automated
> tests in browsers.
>
> Thanks,
> Carla
>
> Andrew Wilson wrote:
>
> > Does Dojo use Selenium for any of its tests?
> >
> > I know I could (eventually) figure out the answer to this by examining
> > the source tree, but I'm a little scared by the source tree right now.
> > (I'm new to both Ant and Java.)
> >
> > -- Andrew
> >
> > On 11/20/06, *Brian Douglas Skinner* <skinner at dojotoolkit.org
> > <mailto:skinner at dojotoolkit.org>> wrote:
> >
> >     Just wanted to chime in with a +1 for both of Bill's unit testing
> >     requests...
> >
> >     in-browser tests:
> >        It'd be great to be able to automatically run the unit tests
> >     in-browser.  For example, some of the dojo.lang code executes
> >     differently in Rhino vs. IE vs. Firefox, so it'd be good to be able
> to
> >     easily test in a variety of environments.  Likewise, the new
> >     dojo.data.OpmlStore is running nicely in Firefox but not yet
> >     working in
> >     IE.  Once we get that code working in IE, it would be good to
> >     regularly
> >     test it there, rather than just testing in Rhino.
> >
> >     spurious error messages:
> >        Bill suggested output like in eclipse (or other junit UIs).
> >     Something like that would be great.  For OpenRecord we've been using
> >     Hieatt's JsUnit, which has a nice clear red-bar/green-bar UI:
> >        http://www.jsunit.net/documentation/runnerExample.html
> >     <http://www.jsunit.net/documentation/runnerExample.html>
> >     The red/green UI nicely emphasizes the 1-bit piece of info that I
> >     really
> >     care about.  In contrast, the 'ant test' unit tests currently
> generate
> >     over 200 lines of output.  Would it be better if by default 'ant
> >     test'
> >     would only generate 1 or two lines of output?  Something like:
> >        test: PASSED
> >     or
> >        test: FAILED
> >        test: failed in test_ComboBox.js#test_combobox_dataprovider : 83
> >
> >     ~ skinner
> >
> >
> >     Bill Keese wrote:
> >     > Hi Jesse,
> >     >
> >     > I'd like to talk about how we can make the unit tests
> >     better.  There are
> >     > two issues for me right now, (1) spurious error messages and (2)
> >     > in-browser unit tests.
> >     >
> >     > 1. spurious error messages
> >     >
> >     > Running "ant test" from buildscripts directory produces a bunch of
> >     > messages that look like errors, but really aren't.  For example:
> >     >
> >     > [dojo-test] WARNING: 7:56:57 AM JST: dojo.log.warn() working
> >     correctly
> >     > [dojo-test] ERROR: 7:56:57 AM JST: dojo.log.exception() working
> >     > [dojo-test] CRITICAL: 7:56:57 AM JST: dojo.log.crit() working
> >     correctly
> >     >
> >     > Can we suppress those somehow?  It's hard to tell where the real
> >     errors
> >     >  happened.  I guess I'd like the output to be like in eclipse
> >     (or other
> >     > junit UIs), like
> >     > http://www.onjava.com/pub/a/onjava/2004/02/04/juie.html?page=2
> >     <http://www.onjava.com/pub/a/onjava/2004/02/04/juie.html?page=2>
> >     >
> >     >
> >     > 2. in-browser tests
> >     >
> >     > There are lots of test that need to be run from the browser, *but*
> >     > are/can-be automatic (ie, unit tests), such as:
> >     >
> >     > http://archive.dojotoolkit.org/nightly/tests/test_bootstrap.html
> >     >
> >
> http://archive.dojotoolkit.org/nightly/tests/style/test_style_setBox.html
> >     <
> http://archive.dojotoolkit.org/nightly/tests/style/test_style_setBox.html>
> >     >
> http://archive.dojotoolkit.org/nightly/tests/style/test_sizing.html
> >     >
> >     > Maybe we can find a way to standardize those tests.  In
> >     particular, note
> >     > the third link above... you can't tell if it worked or not without
> >     > studying the output; but it could just print a "success/failure"
> >     error
> >     > message.
> >     >
> >     > Actually, it's probably better if all the unit tests could be
> >     run from
> >     > the browser; just because something works in rhino doesn't mean
> >     it will
> >     > work in IE.
> >     >
> >     >
> >     > Bill
> >     >
> >     > Jesse Kuhnert wrote:
> >     >> Please try to run the unit tests when you can. I know everyone is
> >     >> working hard, but I'd like to keep whatever automated versions of
> >     >> these things we have running for as long as possible. (The
> >     change made
> >     >> was previously caught by the same exact unit test btw, I
> >     updated and
> >     >> fixed it last time but thought I should say something now...)
> >     >>
> >     >> --
> >     >> Jesse Kuhnert
> >     >> Tapestry/Dojo/(and a dash of TestNG), team member/developer
> >     >>
> >     >> Open source based consulting work centered around
> >     >> dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
> >     >>
> >     >>
> >     >>
> >
> ------------------------------------------------------------------------
> >
> >     >>
> >     >> _______________________________________________
> >     >> dojo-contributors mailing list
> >     >> dojo-contributors at dojotoolkit.org
> >     <mailto:dojo-contributors at dojotoolkit.org>
> >     >> http://dojotoolkit.org/mailman/listinfo/dojo-contributors
> >     > _______________________________________________
> >     > dojo-contributors mailing list
> >     > dojo-contributors at dojotoolkit.org
> >     <mailto:dojo-contributors at dojotoolkit.org>
> >     > http://dojotoolkit.org/mailman/listinfo/dojo-contributors
> >     <http://dojotoolkit.org/mailman/listinfo/dojo-contributors>
> >
> >     _______________________________________________
> >     dojo-contributors mailing list
> >     dojo-contributors at dojotoolkit.org
> >     <mailto:dojo-contributors at dojotoolkit.org>
> >     http://dojotoolkit.org/mailman/listinfo/dojo-contributors
> >
> >
> >------------------------------------------------------------------------
> >
> >_______________________________________________
> >dojo-contributors mailing list
> >dojo-contributors at dojotoolkit.org
> >http://dojotoolkit.org/mailman/listinfo/dojo-contributors
> >
> >
>
> _______________________________________________
> dojo-contributors mailing list
> dojo-contributors at dojotoolkit.org
> http://dojotoolkit.org/mailman/listinfo/dojo-contributors
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.dojotoolkit.org/pipermail/dojo-contributors/attachments/20061206/7618094e/attachment.htm 


More information about the dojo-contributors mailing list