Skip to content

Commit eab5fab

Browse files
fhoebenEqerem-Hena
andauthored
One rerun prefix (#1519)
Co-authored-by: Eqerem-Hena <[email protected]>
1 parent a3c0ce3 commit eab5fab

File tree

3 files changed

+39
-3
lines changed

3 files changed

+39
-3
lines changed

Diff for: FitNesseRoot/FitNesse/ReleaseNotes/content.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
!2 Pending Changes
2-
* Allow usage of JDK > 18 ([[1513][https://github.com/unclebob/fitnesse/pull/1513]]).
3-
* Added a new configuration to limit the total amount of test histories per page. ([[1510][https://github.com/unclebob/fitnesse/pull/1510]])
2+
* Allow usage of JDK > 18 ([[1513][https://github.com/unclebob/fitnesse/pull/1513]]).
3+
* Added a new configuration to limit the total amount of test histories per page. ([[1510][https://github.com/unclebob/fitnesse/pull/1510]])
4+
* Do not add 'RerunLastFailures_' prefix on failure of re-run ([[1519][https://github.com/unclebob/fitnesse/pull/1519]])/
45

56
!2 20240219
67
* Added the defined values to the overview of all variables in scope. ([[1472][https://github.com/unclebob/fitnesse/pull/1472]])

Diff for: src/fitnesse/responders/run/SuiteResponder.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,12 @@ protected String getRerunPageName() {
295295
PageCrawler pageCrawler = page.getPageCrawler();
296296
WikiPagePath fullPath = pageCrawler.getFullPath();
297297
String fullPathName = PathParser.render(fullPath);
298-
return "RerunLastFailures_"+fullPathName.replace(".","-");
298+
if (fullPathName.startsWith("RerunLastFailures_")) {
299+
String newFullPathName = fullPathName.replace(".", "-");
300+
return newFullPathName;
301+
} else {
302+
return "RerunLastFailures_" + fullPathName.replace(".", "-");
303+
}
299304
}
300305

301306
protected String getTitle() {

Diff for: test/fitnesse/responders/run/SuiteResponderTest.java

+30
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,36 @@ public void loadsCustomFormatters() throws Exception {
565565
assertTrue(FooFormatter.initialized);
566566
}
567567

568+
@Test
569+
public void testGetRerunPageName_withRerunPrefix() throws Exception {
570+
String rerunPageName = "RerunLastFailures_SuitePage";
571+
suite = WikiPageUtil.addPage(root, PathParser.parse(rerunPageName), "This is a rerun page\n");
572+
request.setResource(rerunPageName);
573+
responder.makeResponse(context, request);
574+
575+
String result = responder.getRerunPageName();
576+
assertEquals(rerunPageName, result);
577+
}
578+
579+
@Test
580+
public void testGetRerunPageName_ReplacesPeriod() throws Exception {
581+
addTestToSuite("TestTwo", "|!-fitnesse.testutil.FailFixture-!|\n\n|!-fitnesse.testutil.FailFixture-!|\n");
582+
request.setResource("SuitePage.TestTwo");
583+
responder.makeResponse(context, request);
584+
585+
String result = responder.getRerunPageName();
586+
assertEquals("RerunLastFailures_SuitePage-TestTwo", result);
587+
}
588+
589+
@Test
590+
public void testGetRerunPageName_withoutRerunPrefix() throws Exception {
591+
request.setResource("SuitePage");
592+
responder.makeResponse(context, request);
593+
594+
String result = responder.getRerunPageName();
595+
assertEquals("RerunLastFailures_SuitePage", result);
596+
}
597+
568598
private String runSuite() throws Exception {
569599
Response response = responder.makeResponse(context, request);
570600

0 commit comments

Comments
 (0)