fescobar / allure-docker-service

This docker container allows you to see up to date reports simply mounting your "allure-results" directory in the container (for a Single Project) or your "projects" directory (for Multiple Projects). Every time appears new results (generated for your tests), Allure Docker Service will detect those changes and it will generate a new report automatically (optional: send results / generate report through API), what you will see refreshing your browser.
Apache License 2.0
636 stars 183 forks source link

Allow compressed result file upload #149

Open janisliepins opened 3 years ago

janisliepins commented 3 years ago

It would be great to be able to POST compressed test result files (.zip, .tar formats) Need for this arises when i am trying to send several thousand result files to /send-results endpoint.

fescobar commented 3 years ago

@janisliepins what is the problem sending multiple files?

janisliepins commented 3 years ago

@janisliepins what is the problem sending multiple files?

Well in my case i have several thousand of those result files (in one case around 11 000). So i had to modify some flask options like max_request_body_size for app to be able to handle all those files ... + had issues with allure service host VM where regularly inode limit was reached for the filesystem because of the enormous file count.

This could be all resolved with result archiving - e.g. like for Jenkins Allure plugin - where Jenkins creates ZIP archive for Allure report.

Also question and possible solution - maybe i can send Junit report.xml file to the Allure service? Is it possible? have not tried it yet ....

kormachevt commented 3 years ago

Would be a superb feature. I stumbled upon 'Argument list is too long' error from curl during an attempt to send over 4000 files. Currently my workaround is splitting array, but archiving the report would solve this problem entirely.

arekmadej commented 3 years ago

I've also started to see some issues around sending large amounts of files leading to reliability issues to our nightly automation runs. I'm happy to implement the functionality to allow sending compressed files to the API endpoint and handing it accordingly as long as @fescobar is ok with this

fescobar commented 3 years ago

@arekmadej Go ahead, please. Fork the project and when you finished your implementation, please create a pull request again my beta branch. I will test it in there. Also, it would be good if you can add an example here:: https://github.com/fescobar/allure-docker-service#send-results-through-api

Thank you in advance

fescobar commented 3 years ago

@arekmadej the flow will be the next:

  1. POST https://github.com/fescobar/allure-docker-service/blob/master/allure-docker-api/app.py#L851
  2. Validate extension of file zip received
  3. Put the zip inside the container in path /tmp and extract it in there with a directory with a UID name.
  4. Move the files extracted to the allure-results directory

You need to move first the zip to the temporal directory, otherwise, the automatic check results will be executed and will generate another report. For that reason, don't move directly the zip to the allure-results directory.

Any questions let me know.

rob-spoor commented 2 years ago

Is there any progress on this feature? Because we're running into timeout issues with "just" 2200 files, that we hope could be resolved by uploading a single, smaller file.