Search code examples
scalatestingscalatestdruid

How to write integration tests depending on Druid?


I am coding an application that generates reports from a Druid database. My integration tests need to read data from that database.

My current approach involves creating synthetic data for each of the tests. However, I am unable to remove data created from the database (be it by removing entries or completely dropping the schema). Tried this but still getting data back after disabling the segment and firing the kill task.

I think that either I am completely wrong with my approach or there is a way to delete information from the database that I haven't been able to find.


Solution

  • In the end I worked around the issue by inserting data in Druid with ids specific to each unit test and querying for that.

    Not very elegant since now one malicious test can (potentially) mess with the results of another test.