Strategy for resetting test data? | adam | 2013-06-06 11:51 |
Status: Closed | ||
I think Ben's suggestion is a good way to go... we try to avoid writing tests that assume specific auto-increment values, for just this reason. But to answer your previous question, yes, if you require a fixed starting value from a database-managed sequence then you would have to execute that PostgreSQL-specific "TRUNCATE..." SQL in a hidden API (e.g., via SqlExecutor.execute()). Another option (starting in 13.2) would be to use a DbSequence to populate the RowId. A DbSequence is a LabKey-managed virtual sequence that gives you more control over an auto-incrementing sequence. Probably not a good route in this case since you don't want to rework the code, but it might be useful in other scenarios. Adam |
||