Add unit tests for each rule so that we can check the case that it detects.
This means refactoring the code so that we can run each unit tests for a single rule only on a table or schema that we create based on some existing code. Since we want to avoid getting false positives if messages are changed, we should be able to get a "report" from a rule run that just contains the rule id and the parameters resulting from the SELECT. That way, we can just make sure that the rule triggers (or does not trigger) for particular objects in the database.
Example
[Add an example unit tests here.]
### Tasks
- [x] Refactor to be able to run an individual rule (#22)
- [x] Add unit tests for compression rules (#22)
- [x] Add TestCase class for setting up database for unit tests (#34)
- [x] Add rule identifier for each report
- [ ] https://github.com/timescale/doctor/pull/43
- [ ] https://github.com/timescale/doctor/pull/45
Add unit tests for each rule so that we can check the case that it detects.
This means refactoring the code so that we can run each unit tests for a single rule only on a table or schema that we create based on some existing code. Since we want to avoid getting false positives if messages are changed, we should be able to get a "report" from a rule run that just contains the rule id and the parameters resulting from the SELECT. That way, we can just make sure that the rule triggers (or does not trigger) for particular objects in the database.
Example
[Add an example unit tests here.]