You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bloodhound.apache.org by Antonia Horincar <an...@gmail.com> on 2013/07/28 01:53:21 UTC

[GSoC - Embeddable objects] Testing the plugin

Hi,

I have a question regarding testing. My plugin consists only of controllers
and views, and doesn't include models, therefore I can't do unit tests on
it. What kind of tests should I write?

Thanks,
Antonia

Re: [GSoC - Embeddable objects] Testing the plugin

Posted by Olemis Lang <ol...@gmail.com>.
On 7/27/13, Antonia Horincar <an...@gmail.com> wrote:
> Hi,
>
> I have a question regarding testing. My plugin consists only of controllers
> and views, and doesn't include models, therefore I can't do unit tests on
> it. What kind of tests should I write?
>

Ideas ...

If you have views they should be populated with data ; you could unit test that

You will be able to write functional tests once patches for #387 will
be committed in /trunk .

-- 
Regards,

Olemis.

Apacheā„¢ Bloodhound contributor
http://issues.apache.org/bloodhound
http://blood-hound.net

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:

Re: [GSoC - Embeddable objects] Testing the plugin

Posted by Ryan Ollos <ry...@wandisco.com>.
On Sat, Jul 27, 2013 at 4:53 PM, Antonia Horincar <
antonia.horincar@gmail.com> wrote:

> Hi,
>
> I have a question regarding testing. My plugin consists only of controllers
> and views, and doesn't include models, therefore I can't do unit tests on
> it. What kind of tests should I write?
>
> Thanks,
> Antonia


The functional tests that Olemis mentioned are written in Twill, with
wrapper and library of supporting functions written by the Trac team, found
in the trac/tests/functional module.

I found getting up to speed on writing the functional tests in Twill to be
a bit challenging, and I spent many frustrating hours dealing with various
little issues before I started to feel at least minimally proficient. As an
example of the issues I encountered, see:
http://trac.edgewall.org/ticket/11118#comment:3

The other drawback is that you can't test JavaScript code with Twill.

I think what we really need is to replace Twill with a different functional
testing framework, but that is a large project of its own. Therefore, I
think your best move is to write the unit tests as Olemis suggests, and
maybe we'll add a few Twill functional tests before the work is integrated
to the Bloodhound trunk, but I wouldn't suggest spending too much time on
that yourself, at least until you feel your project has reached all of its
major milestones.