GHPReporter/Ghpr.Core

Old test results should have an ability to be discarded/deleted

Sedemicra opened this issue · 8 comments

I know it is possible to determine how many runs are displayed in the report html. Is it also possible to determine how many is kept in general?
I will be having many runs and over time the logs will grow massive, which I would like to avoid. I would like to be able to set a limit based on either a number of runs or time to completely delete all older logs. I haven't been able to find such possibility. Is there one? If not, would it be possible to have such feature implemented?
Thanks in advance!

Hi @axinom-raido !

You can set up the default amount of test runs and tests to be loaded by editing settings .json file:
https://github.com/GHPReporter/Ghpr.Core#about-settings-file

Deleting old test runs may be implemented later as part of Ghpr.Console functionality.

Thank you

Thank you for confirming my suspicions.
Being able to set the limit of how many testruns are preserved in total would be much appreciated feature as it would help to keep total logs in reasonable size without losing the latest results. I guess I need to look for an alternative until such option is available.
Thanks again for quick answer.

Hi @axinom-raido !
Can you please let me know what exact data you want to able to delete?

The plan is to implement this feature as part of Ghpr.Console application and give users an ability to detele old runs (probably by passing date argument into console app and deleting all data older than the given date)

Hi, thanks for bringing this up.
Basically our interest would be to have the possibility to set both the number of reports to keep and time range for how long to keep them.
Ideally on each testrun when a report is generated there would be 2 checks:

  1. If a number of reports to keep is defined as x, only the last x reports are kept and any older ones are fully discarded.
  2. If the time range is set i.e. as y days every report older than y days is discarded.
    In case of both conditions are set we would apply the most strict one.

Since you asked what data exactly we would like to delete - the answer is everything older than the set parameters described above.
Ideally these restrictions could be defined in the same file where we define the number of reports displayed in html. This way the configurations would be in the same location making it relatively easy to change them and apply on next run.

Hi @axinom-raido !
Thank you very much for detailed explanation. Agreed to create "clean up" job that can be run after a new report is generated.

Now old runs can be deleted using retention section from reporter .json settings:

 "retention": {
   "amount": 10,
   "till": "2018-06-29 10:00:00"
 }

This clean up job will run each time after the new report is generated.
amount - total runs that will be left, all other will be deleted.
till - all runs with finish date older than this value will be deleted too.

There is no way to restore the data, so please use these settings carefully.

Released in v0.9.2

Thank you. Will try this out once I get time.