Reports are overwritten by retry run (Jenkins)


#1

Hi guys,

i am using Jenkins to run my test cases with the following command:

xvfb-run -a ./katalon -noSplash -runMode=console -consoleLog -projectPath="/tests/katalon/Automation.prj" -reportFolder="Reports/regression" -reportFileName="report_$BUILD_NUMBER" -retry=1 -retryFailedTestCases=true -testSuitePath="Test Suites/Regression" -executionProfile="default" -browserType="Firefox (headless)"

I am writing the reports into the specific subfolder Reports/regression/ and have configured to retry the failed test cases.
My issue is that if a test case failes and will be retried, my report file only contains the retried cases. It looks like the report file from the “initial run” is simply overwritten.

Am i doing something wrong?

Best regards,
Said


#2

any solution ?


#3

Thank you for the question. I’ve moved this into Feature / Improvement Suggestions for consideration.


#4

My workaround for the moment (a custom Listner) :
Under the Folder Test Listeners you can create a new file which contains the Listners you want

import org.apache.commons.io.FileUtils



class Change_report_name_if_exist {
	
	@AfterTestSuite
	def printInfo(TestSuiteContext testSuiteContext) {

		
		

		Date today = new Date()
		String todaysDate = today.format('yyyy-MM-dd HH_mm_ss')

		
		FileUtils.moveFile(
			FileUtils.getFile("/path/JUnit_Report.xml"),
			FileUtils.getFile('/path/'+todaysDate+'.xml'));  
	
		  
}
}