Thanks for all the ideas here. I think I've settled on my implementation 
for this, it's a little different than what's been suggested but I think 
it's efficient and clean. The ModifiedLogRotator subtracts the daysToKeep 
integer from the Calendar.DAY_OF_YEAR record. I've added a test class 
called ageUnitTest() to the plugin logic which adds a double of the 
daysToKeep integer if it is stubbed to return true (otherwise it is always 
false). All builds recorded are thereby seen as beyond the max age limit 
and processed accordingly.

I believe this offers coverage for all logic changes I've introduced with 
this update.

Relevant PR is here: 
https://github.com/jenkinsci/enhanced-old-build-discarder/pull/3
Relevant test file is here: 
https://github.com/jenkinsci/enhanced-old-build-discarder/blob/94eb28fcc52f32d00e5301e1615e571769076c17/src/test/java/org/jenkinsci/plugins/enhancedoldbuilddiscarder/EnhancedOldBuildDiscarderTest.java
Main plugin source: 
https://github.com/jenkinsci/enhanced-old-build-discarder/blob/94eb28fcc52f32d00e5301e1615e571769076c17/src/main/java/org/jenkinsci/plugins/enhancedoldbuilddiscarder/EnhancedOldBuildDiscarder.java

It is now PR#3, as the repository maintainer decided to merge my previous 
PR's. I've commented and tried to contact him to tell him that PR#2 needed 
review and shouldn't have been merged, but I haven't been able to get in 
touch with him.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/86d2d274-ae3e-4aa2-bdf5-113e1b27c9e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to