Merge branch 'feature/pipeline_retry' into 'master'

Added @retry decorator with default values

See merge request cara/cara!354
This commit is contained in:
Andre Henriques 2022-05-11 16:15:30 +02:00
commit 72dfcfa5a0
4 changed files with 11 additions and 1 deletions

View file

@ -2,11 +2,12 @@ from pathlib import Path
import pytest
import tornado.testing
from retry import retry
import cara.apps.calculator
from cara.apps.calculator.report_generator import generate_permalink
_TIMEOUT = 30.
_TIMEOUT = 20.
@pytest.fixture
def app():
@ -42,6 +43,7 @@ async def test_404(http_server_client):
assert resp.code == 404
@retry()
class TestBasicApp(tornado.testing.AsyncHTTPTestCase):
def get_app(self):
return cara.apps.calculator.make_app()
@ -70,6 +72,7 @@ class TestBasicApp(tornado.testing.AsyncHTTPTestCase):
assert 'expected number of new cases is' in response.body.decode()
@retry()
class TestCernApp(tornado.testing.AsyncHTTPTestCase):
def get_app(self):
cern_theme = Path(cara.apps.calculator.__file__).parent.parent / 'themes' / 'cern'
@ -82,6 +85,7 @@ class TestCernApp(tornado.testing.AsyncHTTPTestCase):
assert 'expected number of new cases is' in response.body.decode()
retry()
class TestOpenApp(tornado.testing.AsyncHTTPTestCase):
def get_app(self):
return cara.apps.calculator.make_app(calculator_prefix="/mycalc")

View file

@ -1,6 +1,7 @@
import numpy as np
import numpy.testing as npt
import pytest
from retry import retry
import cara.monte_carlo as mc
from cara import models,data
@ -307,6 +308,7 @@ def waiting_room_mc():
)
@retry()
@pytest.mark.parametrize(
"mc_model, expected_pi, expected_new_cases, expected_dose, expected_ER",
[

View file

@ -64,6 +64,7 @@ python-dateutil==2.8.2
pyzmq==22.1.0
requests==2.26.0
requests-unixsocket==0.2.0
retry==0.9.2
scikit-learn==0.24.2
scipy==1.7.0
Send2Trash==1.7.1
@ -76,6 +77,7 @@ threadpoolctl==2.2.0
timezonefinder==5.2.0
tornado==6.1
traitlets==5.0.5
types-retry==0.9.7
urllib3==1.26.6
voila==0.2.10
wcwidth==0.2.5

View file

@ -30,10 +30,12 @@ REQUIREMENTS: dict = {
'numpy',
'psutil',
'python-dateutil',
'retry',
'scipy',
'sklearn',
'timezonefinder',
'tornado',
'types-retry',
'voila >=0.2.4',
],
'app': [],