From 818f7bf9e74844bef7ec7719cebf078b6b304401 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Thu, 19 Sep 2024 08:49:42 +0200 Subject: [PATCH 1/2] Remove print secret requirements The goal it to don't have to migrate to new shared config manager to be able to have secrests. --- print/print-apps/geomapfish/config.yaml.tmpl | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/print/print-apps/geomapfish/config.yaml.tmpl b/print/print-apps/geomapfish/config.yaml.tmpl index 2650b0ad0..cc72e47f5 100644 --- a/print/print-apps/geomapfish/config.yaml.tmpl +++ b/print/print-apps/geomapfish/config.yaml.tmpl @@ -4,23 +4,6 @@ throwErrorOnExtraParameters: true defaultToSvg: true resourceBundle: localisation -smtp: - username: ${SMTP_USER} - password: ${SMTP_PASSWORD} - fromAddress: info@camptocamp.com - host: email-smtp.eu-west-1.amazonaws.com - port: 465 - ssl: True - subject: Map from GeoMapFish demo - body: Your printed map form GeoMapFish demo is here. - storage: !s3reportStorage - bucket: print-mutualized - prefix: gmf_demo - endpointUrl: https://sos-ch-dk-2.exo.io/ - region: ch-dk-2 - accessKey: ${AWS_ACCESS_KEY_ID} - secretKey: ${AWS_SECRET_ACCESS_KEY} - allowedReferers: &allowedHosts ${DISABLE_MUTUALIZED_PRINT}- !hostnameMatch ${DISABLE_MUTUALIZED_PRINT} host: ${MUTUALIZED_PRINT_URL} From 2486df258a267809b57e26b7e7a4c533a19ce4f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Thu, 19 Sep 2024 09:13:10 +0200 Subject: [PATCH 2/2] Add retry --- tests/test_app.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/test_app.py b/tests/test_app.py index 599e21fd3..2599b7e96 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -1,3 +1,4 @@ +import time from typing import Dict import pytest @@ -32,7 +33,16 @@ ) def test_url(url: str, params: Dict[str, str], timeout: int) -> None: """Tests that some URL didn't return an error.""" - response = requests.get(url, params=params, verify=False, timeout=timeout) # nosec + code = 503 + count = 0 + while code == 503 and count < 5: + response = requests.get(url, params=params, verify=False, timeout=timeout) + code = response.status_code + count += 1 + if code == 503: + print(f"Retry {count} for {url}") + time.sleep(1) + assert response.status_code == 200, response.text