removal of setupTest and teardownTest

4 views
Skip to first unread message

Jeff Hammel

unread,
Mar 15, 2011, 7:53:50 PM3/15/11
to mozmi...@googlegroups.com
Currently, thought its not widely used at least in QA's mozmill tests,
we have functions setupTest and teardownTest. We plan on deprecating
these for mozmill 2.0, slated for release soon (before April, we
hope).

See https://bugzilla.mozilla.org/show_bug.cgi?id=641991

The reason for this is that we want "what is a test" to be atomic --
that is, there is something called a test that is the lowest level
"thing" that makes sense to run. You can't run part of a test -- that
makes no sense. A test may have arbitrary states and transitions
within it, but these are part of a test (which is to say, they are not
strictly unit test). In this case, having setupTest and teardownTest
is a bit silly and setupModule and teardownModule make more sense.

Restate our assumptions:
- a test file/module == a test
- this module will have (at least one) test* function and optionally
setupModule and teardownModule
- usually you'll want a single test function; you can probably get rid of
testSetup and testTeardown
- but running a single test function doesn't, in general, make much sense, as
there make be state accumulated via previous tests
- so the normal case is "a test == a single file with one test* function and
potentially a setupModule + teardownModule function

So if you're not using the assumption that 1 test == 1 file...you
should! Or if you have any concerns, please reply to this list or
reply to bug and we can discuss issues there.

Jeff

Henrik Skupin

unread,
Mar 15, 2011, 8:00:19 PM3/15/11
to mozmi...@googlegroups.com
Jeff Hammel wrote on 3/16/11 12:53 AM:

> Currently, thought its not widely used at least in QA's mozmill tests,
> we have functions setupTest and teardownTest. We plan on deprecating
> these for mozmill 2.0, slated for release soon (before April, we
> hope).

At least in our case we want to get rid of those test files and spread
out the tests into different modules. So it sounds fine with me.

--
Henrik Skupin
QA Execution Engineer
Mozilla Corporation

Reply all
Reply to author
Forward
0 new messages