Toad World® Forums

Advice on initialisation/cleanup for test cases


#1

I am looking for a bit of advice here.

I am currently testing procedures that insert rows into tables.

To test a proc that say insert into table A (no commit)
I have, for each test case

  • a.initialisation that creates the rows that must exist before the run, e…g. the parent row in table B of the row to insert into A
  • b. the test case run
  • c. cleanup: delete all rows created in a. and b.

When an error occurs in one of the tests (e.g 2 tests are successful, 1 fails) the cleanup step does not seem to happen and I have to delete all rows manually otherwise all tests start to fail

am I missing something here? Is it normal behaviour from the tool? Is it a good practice issue or an issue with the tool?

Is the solution to have the cleanup code repeated in the initialisation step for each test case?

Philippe


#2

I know that this is a VERY late reply, but “better late than never” ?

The behavior you describe is a bug. We neglected to run cleanup when an error occurs. We now do that (I believe this was added to some extent in 1.6 and then fully completed in 1.8 - due out end of this month - Feb 2008).

Regards, SF