allure-framework / allure2

Allure Report is a flexible, lightweight multi-language test reporting tool. It provides clear graphical reports and allows everyone involved in the development process to extract the maximum of information from the everyday testing process
https://allurereport.org/
Apache License 2.0
4.21k stars 712 forks source link

Add "generate"/"serve" option to copy new history folder from "allure-report" to "allure-results" folder #997

Open performrumpf opened 5 years ago

performrumpf commented 5 years ago

Allure creates very beautiful reports for tests, but when generating reports locally (not with CI systems like Jenkins) and keep track of your previous test results it is always necessary to copy/paste the history folder to "allure-results". It can cause some tracking issues when a user forgets to do that even a single time.

Suggestion Add an option to command "generate" and "serve" to copy/create history folder to <directory-of-results>.

Examples:

fescobar commented 5 years ago

@performrumpf if you want to keep the history, there is no any other way to do that. If you want to keep the history locally you could use docker containers like this https://github.com/fescobar/allure-docker-service

performrumpf commented 5 years ago

Thanks for notifying me about the docker solution. But I thought having a build-in feature to copy history files might be a good idea. Jenkins is doing this automatically according to your documentation.

cinderblock commented 4 years ago

This feature is sorely missing in allure. I'm really surprised that allure doesn't automatically save all of what it needs to generate trend reports when it already keeps around old results "automatically".

It also seems to be rather under-documented that the history folder needs to be copied from allure-report to allure-results every time for trends to be properly displayed. The one place that does mention this is only in the context of Jenkins and seems to have a broken link to [Learn more about History plugin].

MS2305 commented 4 years ago

Better we can write a code using 'fs-extra' to copy that history folder from Allure_Report to Allure_results every time, I did that successfully. find my below code.

  1. First I used fs.Pathexists to ensure history folder is available in Allure-report
  2. If the history folder exists in allure-report, I used fs.copy to copy that folder and paste it in my destination.
var pathexists = await fs.pathexists('../Report_File/Output_Reports/Allure_Report/Allure_HTML_report/history');
    if (pathexists === true) {
      console.log('History Path Exists Status:' + pathexists);
      fs.copy('../Report_File/Output_Reports/Allure_Report/Allure_HTML_report/history', '../Report_File/Output_Reports/Allure_Report/Allure_XML_results/history');