[Rt-devel] [TESTS][BUG] Wrote some API tests
Ruslan U. Zakirov
Ruslan.Zakirov at acronis.com
Fri Dec 10 13:35:12 EST 2004
Jesse Vincent wrote:
>
>>>More than that fail when it's run as part of the test suite, since it
>>>includes some assumptions about the starting database. I'm working on
>>>patching that first.
>>
>>I argue. It does include one assumption about DB: DB should be just
>>after 'make initdb'. Jesse, I think if you want >90% test coverage then
>>test suit would be very big and it would be problem if one test file
>>would be rely on data inserted by other files. IMHO we should reinit DB
>>before each file. Yes, it would be slower, but allow to run this or that
>> test file only.
>
>
> I strongly disagree with that. A chunk of the test suite should be able
> to run with either a clean database _or_ the rest of the test suite
> having been run. Which is now the case for the tests you wrote.
>
So _please_ show me how my test file can be rewriten to be independant
from other tests/DB data and check all the cases that it checks now.
It's the pain to write tests and take on mind that DB can contain any
data. It would be pain to track why your new tests break some tests in
other files that runs after yours. Contributor can not even know how
tests in that files works.
Are you shure that you can always write tests that would be absolutely
independant from data in DB. I have great confidence that I can't write
some tests if I'm not sure that DB in some well known state.
IMHO it's also a reason why people doesn't contribute test suites.
May be I don't know something, but I don't know how to run this or that
test file in current RT test suit. Next command I was using to run my
test file after each edition:
./configure --with-web-user=apache --with-web-group=apache
--with-devel-mode; sudo sh reinitdb_silent.sh; sudo perl
lib/t/09record_customfields.t
Is it normal for test case?
Next is normal:
make test TEST_FILES=lib/t/09record_customfields.t
SVK is an example. Add SKIP block to one test in the middle of file and
all subsequent tests in this file will fail.
May be we should open discussion on perl.qa?
If you help us write test cases easier in any way then at least I spend
more time to add more tests to RT API.
Best regards. Ruslan.
PS: I must read more English literature to describe my philosophical
thoughts easier :/
More information about the Rt-devel
mailing list