This is because CLEAN_INSERT does "CLEAN" before the test, and not after the test.
For example, if there are two tests, test1 and test2. test1 and test2 populate the tables from test1.xml and test2.xml, respectively.
test1.xml is similar to
<dataset> <table1 ... /> <table2 ... /> </dataset>
test2.xml is similar to
<dataset> <table1 ... /> </dataset>
When the order of the tests is test1 and then test2, CLEAN_INSERT will perform the following operations:
- delete everything from table2
- delete everything from table1
- insert data from test1.xml into table1
- insert data from test1.xml into table2
- run test1
- delete everything from table1
- insert data from test2.xml into table1
- run test2
So, when test2 is executed, table 1 contains the data from test2.xml, which is what we expect. But table2 still contains data for test1, which may cause some problems.
The workaround is to have an empty row for each table in all xml files. He will ensure that all tables are cleaned before insertion.
In the example above
test1.xml will look like
<dataset> <table1 ... /> <table2 ... /> <table1 /> <table2 /> </dataset>
test2.xml is similar to
<dataset> <table1 ... /> <table1 /> <table2 /> </dataset>
source share