Recommendations on the clean up rules
Why is it important?
Allure TestOps collects all your test results data in the database and in the artefacts storage.
Test results artefacts aka test results attachments are usuially stored in a S3 storage.
Theoretically you can store infinite data amounts to see how is was going 1-2-3-N years ago.
In reality – alas! – the more data you store in the database and in the storage, the more money it costs you, and the less is the database performance – even if you don't retreive the data for tests you've executed 3 years ago, this information stored in the database slows down the select requests for the data you added just now.
Artefacts consume considerable amount of space, so you need to delete those artefacts that do not provide any insights but cosume space (money) on a regular basis.
Built-in artefacts storage cleanup routines
Thisngs to consider
Allure TestOps' built-in cleanup routine deletes only the artefacts for the closed launches, i.e. even if your rule states that files are to be deleted in 24 hours and a launch is in the open state, none of the artefacts of such launch will be deleted.
Generally, the clean up is described here.
Types of artefacts
In Allure TestOps there are following types of artefacs:
- test results attachments, usually several per a test result
- fixtures attachments,
- scenarios of testresults
- scenarios from fixtures
Any of these artefact types can be absent in the in your tests – it all depends on the information you are proividing in your automated tests.
All attachments are stored in the storage. All the scenarios are stored in the database.
So when creating the cleanup rules you need to consider deleting all of artefacts described above.
There are separate rules for the deletion of the artefacts for test results with different statuses, e.g. for successful/failed tests.
For each result status you need to create 3 rules to delete each artefact type.
Hint
For successful tests (passed) it makes sense to keep 1-2 copies of the artefacts defined by the frequency of your tests runs, i.e. if your test runs 1 time per 24 hours, then it is reasonable to delete all the artifacts after, say 36 hours considering the information on the scheduler working (see the link above).
Rules to keep the artefacts for the other statuses depend on your team internal processes: you need to understand how much time is usually needed for the failures analysis and maybe add some guard interval.
Say, if you need 5 working days for the analysis, then delete the artefacts for failed tests after 168 hours (7 full days).
Example
This is not a recommendation but an example, what is the full list of cleanup rules is to be created for the artefacts clean-up.
The delay for the deletion should be defined by your internal processes.