jenkinsci / cucumber-reports-plugin

Jenkins plugin to generate cucumber-jvm reports
https://plugins.jenkins.io/cucumber-reports/
GNU Lesser General Public License v2.1
210 stars 232 forks source link

Report was not successfully completed #190

Closed yael-lorenzo closed 7 years ago

yael-lorenzo commented 7 years ago

Hello, I am running the publish report in my groovy code with the following

step([$class: 'CucumberReportPublisher', jsonReportDirectory: reportPath, fileIncludePattern: domain + '.json', trendsLimit: '50'])

However if the json is valid but contains invalid characters like <�h�e�a�d�>�\r�\n�<�t the process will fail.

I would like to know if I can get the status code of the execution in order to avoid publishing the artifact if the plugin cannot process the file.

Thanks in advanced.

damianszczepanik commented 7 years ago

Try with https://github.com/damianszczepanik/cucumber-reporting/blob/master/src/main/java/net/masterthought/cucumber/ReportResult.java#L63 and examine https://github.com/damianszczepanik/cucumber-reporting/blob/master/src/main/java/net/masterthought/cucumber/Reportable.java#L43

But I would suggest prevention by providing better fileIncludePattern than worrying about consequences.