Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Fried Hoeben <[email protected]>
  • Loading branch information
AlexNetcare and fhoeben authored Mar 27, 2024
1 parent 01baa50 commit 2c4d6c1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ There are more properties which can be used to tweak parts of FitNesse:
* '''VersionsController.days''' - number of days to keep old page versions around when using the Zip file based versions controller.
* '''test.history.days''' - The number of days to keep test results around. Cleaned up after a new test run.
* '''test.history.path''' - Location to store the test results. The default location is ''!-FitNesseRoot-!/files/testResults''.
* '''TestHistory.purgeTime''' - A comma separated list of numbers for purge options on the ''Test History'' page.
* '''TestHistory.purgeTime''' - A comma separated list of the age, in number of days, to offer as purge options on the ''Test History'' page.
* Any variable that can be defined on a wiki page.

The Slim test system has a set of [[custom properties][<UserGuide.WritingAcceptanceTests.SliM]] that can either be set on a page or in the configuration file.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The test result files are named using the following scheme !style_code(YYYYMMDDH
The test files contain the XML that describes the test run. The format of this XML is identical to the XML packet returned by the format=xml flag when you run a test. (See <UserGuide.RestfulTests).

!4 Purging
There are buttons at the top of the ''Test History'' page that allow you to purge old history files. You have your choice of ''all'', ''>7 days'', or ''>30 days''. If you want to purge a different number of days, you can change the ''TestHistory.purgeTime'' in the [[configuration file][<UserGuide.AdministeringFitNesse.ConfigurationFile]] to allow additional purge times or you can use the RESTful URL form. (See [[!-RestfulServices-!][<UserGuide.AdministeringFitNesse.RestfulServices]]).
There are buttons at the top of the ''Test History'' page that allow you to purge old history files. You have your choice of ''all'', ''>7 days'', or ''>30 days''. If you want to purge a different number of days, you can change the ''TestHistory.purgeTime'' in the [[configuration file][<UserGuide.AdministeringFitNesse.ConfigurationFile]] to allow additional purge times, or you can use the RESTful URL form. (See [[!-RestfulServices-!][<UserGuide.AdministeringFitNesse.RestfulServices]]).

You can also clean up the test history right after a test execution. To do so, configure a property ''test.history.days'' in the [[configuration file][<UserGuide.AdministeringFitNesse.ConfigurationFile]] or as a [[page variable][<UserGuide.FitNesseWiki.MarkupLanguageReference.MarkupVariables]] and assign it the number of days you want to keep history.

Expand Down
4 changes: 2 additions & 2 deletions plugins.properties
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ CustomComparators=inverse:fitnesse.slim.test.InverseComparator
test.history.days=1

##
# The given list of numbers represent the time values for purging test histories.
# Test histories older than the given number are being deleted.
# The given list of numbers represent the options offered for purging test histories.
# Test histories older than the given number of days will be deleted.
# The value 0 represents 'Purge all'.
#TestHistory.purgeTime=0,7,30
10 changes: 5 additions & 5 deletions src/fitnesse/resources/javascript/fitnesse.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,19 @@ $(document)
$(document)
.on('change', '.testHistory #purgeGlobal', function() {
const purgeGlobal = "&purgeGlobal=true";
let elems = $("a[href^='?responder=purgeHistory']");
const elems = $("a[href^='?responder=purgeHistory']");

if(this.checked) {
if (this.checked) {
elems.each((index, link) => {
// Only adjust the href if it was not already adjusted
if(!link.href.includes(purgeGlobal)) {
if (!link.href.includes(purgeGlobal)) {
link.href = link.href.substring(link.href.indexOf("?")) + purgeGlobal;
}
});
} else {
elems.each((index, link) => {
// Only adjust the href if it was adjusted before
if(link.href.includes(purgeGlobal)) {
if (link.href.includes(purgeGlobal)) {
link.href = link.href.substring(link.href.indexOf("?"), link.href.length - purgeGlobal.length);
}
});
Expand All @@ -140,7 +140,7 @@ $(document)

// When clicking on a purge link then ask before deletion
function purgeConfirmation(event) {
if(!confirm('Are you sure you want to purge the test histories?')) {
if (!confirm('Are you sure you want to purge the test histories?')) {
event.preventDefault();
return false;
}
Expand Down

0 comments on commit 2c4d6c1

Please sign in to comment.