Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retention - clean up job - Doesn't appear to work #54

Closed
msscribner opened this issue Nov 27, 2019 · 4 comments
Closed

Retention - clean up job - Doesn't appear to work #54

msscribner opened this issue Nov 27, 2019 · 4 comments
Assignees
Projects

Comments

@msscribner
Copy link

I'm setting the Retention amount and till, but old runs remain in the newly generated report.

Steps to reproduce the behavior:
I’ve adjusted the ‘amount’ from 1000 down to 3. When I generate a new report, the ‘Total Runs’ continues to tick up. I’ve adjusted the ‘till’ from "2017-01-25 10:00:00" to "2019-11-27 13:34:00" (Current Date/Time) and when I generate a new report, ALL previously generated reports remain. It does not appear that any reports are removed.

  1. Set Retention:Amount = 3
  2. Set Retention:Till = "2019-11-27 13:34:00"
  3. Generate report with 8 runs

Expected behavior
Expected reports prior to “2019-11-27 13:34:00” to be removed. I expected reports with highlighted dates to be removed.
image

Also expected 'Total Runs' to not exceed 3, but every time a run is executed, the Total Runs increments by one:
image

I was also expect file generated prior to “2019-11-27 13:34:00” to be removed from the 'runs' folder...but they remain.
image

Ghpr.Core.settings.json:
{
"default": {
"outputPath": "C:\ProgramData\Selenium\GHPRReport\Reports\OctopusMaintenance\ALL",
"dataServiceFile": "Ghpr.LocalFileSystem.dll",
"loggerFile": "",
"sprint": "",
"reportName": "OctopusMaintenance",
"projectName": "P1-P2",
"runName": "11/27/19_13:38:33",
"runGuid": "",
"realTimeGeneration": "True",
"runsToDisplay": "15",
"testsToDisplay": "1000",
"retention": {
"amount": 3,
"till": "2019-11-27 13:34:00"
}
},
"projects": null
}

I'm concerned that if 'clean up job' doesn't run, I'll eventually consume all the disk space.

NUGET Package:
I’m using NUGET packages:
Ghpr.Console version="0.9.9.1"
Ghpr.Core version="0.9.9.9"
Ghpr.LocalFileSystem version="0.9.9.9"
Ghpr.MSTestV2 version="0.9.9.1"
Ghpr.NUnit version="0.9.9.9"
MSTest.TestAdapter version="1.4.0"
MSTest.TestFramework version="1.4.0"
NUnit version="3.12.0"
NUnit.Engine version="3.10.0"

Browser: Chrome

@msscribner
Copy link
Author

A little more information:

I'm calling the API: Ghpr.Cli.ReportHelper.GenerateReport (... ). It doesn't appear to me, that this functionality calls the CleanUpJob() method.

I was able to get my process to work by calling:
ReportHelper.GenerateReport(files.ToArray());
var reporter = ReporterFactory.Build(new TestDataProvider());
reporter.CleanUpJob();
reporter.TearDown();

Question:

  1. Should ReportHelper.GenerateReport() call the CleanUpJob() method? Is this a bug?

  2. Is it OK to call the CleanUpJob() method directory (like I stubbed out)?

  3. Should my process interact directly with the Ghpr.Core.Common ... for example:
    var reporter = ReporterFactory.Build(new TestDataProvider());
    var tests = new List<System.Collections.Generic.KeyValuePair<TestRunDto, TestOutputDto>>();

        foreach (var path in paths)
        {
            tests.AddRange(GhprNUnitRunHelper.GetTestRunsListFromFile(path, reporter.Logger)
                .Select(g => new KeyValuePair<TestRunDto, TestOutputDto>(g.GhprTestRun, g.GhprTestOutput)).ToList());
        }
    
        reporter.GenerateFullReport(tests);
        reporter.CleanUpJob();
        reporter.TearDown();
    

@elv1s42
Copy link
Member

elv1s42 commented Dec 4, 2019

Hi @msscribner!
Sorry for the late response.

Regarding your questions.

  1. Yes, this is a bug, I'll fix and include in the next release.
  2. Yes, this is how it's used now by Ghpr.NUnit but missing in the Ghpr.Console.
  3. Yes, it's possible. Your code is very close to what we have in the Ghpr.Console now

Regards,
Evgeniy

@elv1s42 elv1s42 self-assigned this Dec 4, 2019
@elv1s42
Copy link
Member

elv1s42 commented Dec 5, 2019

The bug was in the Ghpr.Console repository, I'll release it today as v0.9.10

@elv1s42
Copy link
Member

elv1s42 commented Dec 5, 2019

This now has been released. Please feel free to reopen the issue or raise a new one in case something is not working.

@elv1s42 elv1s42 closed this as completed Dec 5, 2019
@elv1s42 elv1s42 transferred this issue from GHPReporter/Ghpr.NUnit Dec 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Ghpr Common
  
Archive
Development

No branches or pull requests

2 participants