mcdcorp / opentest

Open source test automation tool for web applications, mobile apps and APIs
https://getopentest.org
MIT License
447 stars 107 forks source link

Please add possibility to remove old logs and uploads #536

Closed TripleG closed 2 years ago

TripleG commented 2 years ago

Hi @adrianth ,

I see that in server.yaml we can specify few parameters regarding retention period of sessions in the db:

sessionHistoryMaxCount
sessionHistoryMinCount
sessionHistoryAgeDays

Could you please also add possibility for cleaning up old files inside the logs and uploads dirs?

adrianth commented 2 years ago

The clean-up logic also deletes the log files and uploads corresponding to the sessions being selected for removal. If you see any sessions being removed but the logs and uploads for those sessions are still there, we might be dealing with a bug. Please let me know if that's the case.

TripleG commented 2 years ago

Yes, the case is exactly this - only the records in the sessions file are cleaned, but the logs and uploads remain existing.

I used this configuration when testing the feature:

sessionHistoryMaxCount = 2
sessionHistoryMinCount = 2
sessionHistoryAgeDays = 1
TripleG commented 2 years ago

Hi @adrianth ,

Were you able to reproduce the bug?

adrianth commented 2 years ago

I did try to reproduce this and the clean-up logic seems to be working as expected. I'm still thinking of possible edge cases that are not handled correctly, but so far everything looks good.

A few things to keep in mind:

Please check again to confirm this is really an issue.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.