allure-docker-service icon indicating copy to clipboard operation
allure-docker-service copied to clipboard

Async report endpoint

Open HardNorth opened this issue 2 years ago • 2 comments

Starting from some amount of Test Cases (300 for my case) report generation begin taking time bigger than a minute. Since allure-docker-service does call on allure-commandline in a synchronous manner that drives me to a situation when my proxy (nginx) count such request as hanged and abort the connection with 504 Gateway Timeout. Apparently that triggers a kill of the python process which handles generation request. And because allure-docker-service communicate with the spawned proccess this process receives SIGPIPE signal and exits leaving report unfinished. My instance running on Kubernetes with many other stuff hanging around, and it's not possible to increase ingress proxt timeout just for the one pod and not for others.

This PR does the following things:

  • Introduce 2 new endpoints: POST and GET for /generate-report/async path
    • POST /generate-report/async returns response immediately and not communicate with the spawned process so it's fully independent
    • GET /generate-report/async return the status of currently processed job: 202 for still processing and 200 for processed
  • Documentation for these two methods above
  • Allure version update
  • Dependecies versions update: all Flask 1.* versions literally broken due to dependency deletion, so that has to be done just to bring it up again
  • All dependencies moved to a single place: requirements.txt file; which is a standard file to store them
  • Some code refactoring to reduce copy-paste

PS: Looks like the repo is out of support for a while. So for those who eagerly want my changes I built a package in my space: https://github.com/HardNorth/allure-docker-service/pkgs/container/allure-docker-service

HardNorth avatar Jul 22 '22 21:07 HardNorth

@fescobar Please review

HardNorth avatar Jul 22 '22 21:07 HardNorth

@fescobar we appear to be seeing this as well

kandji-castle avatar Sep 20 '22 17:09 kandji-castle

The latest changes in upstream were merged, new docker image was built.

HardNorth avatar Oct 15 '22 08:10 HardNorth

@fescobar pls review changes, i need to use async

Phoenix124 avatar Mar 01 '23 20:03 Phoenix124

@HardNorth merge pls last update for Allure 2.21

Phoenix124 avatar Mar 02 '23 12:03 Phoenix124

@Phoenix124 Done

HardNorth avatar Mar 03 '23 13:03 HardNorth

Sorry guys, but I don't have plans to implement async endpoints. The way the Allure native framework works won't allow the async endpoints work properly.

fescobar avatar Mar 06 '23 17:03 fescobar