(app-desk) change backend settings for e2e tests

When we run e2e tests with the CI, we are doing lot of
calls to the backend in a short amount of time. This can
lead to a rate limit particulary on the "user/me" endpoint.
To avoid this, we will use different backend settings
for the e2e tests.
This commit is contained in:
Anthony LC
2024-02-23 16:37:51 +01:00
committed by Anthony LC
parent 51064ec236
commit 3f7e5c88bc
3 changed files with 16 additions and 1 deletions

View File

@@ -115,6 +115,7 @@ jobs:
- name: Set services env variables
run: |
make create-env-files
cat env.d/development/common.e2e.dist >> env.d/development/common
- name: Build and Start Docker Servers
env:

View File

@@ -0,0 +1,3 @@
# For the CI job test-e2e
SUSTAINED_THROTTLE_RATES="200/hour"
BURST_THROTTLE_RATES="200/minute"

View File

@@ -228,7 +228,18 @@ class Base(Configuration):
"PAGE_SIZE": 20,
"DEFAULT_VERSIONING_CLASS": "rest_framework.versioning.URLPathVersioning",
"DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema",
"DEFAULT_THROTTLE_RATES": {"sustained": "150/hour", "burst": "20/minute"},
"DEFAULT_THROTTLE_RATES": {
"sustained": values.Value(
default="150/hour",
environ_name="SUSTAINED_THROTTLE_RATES",
environ_prefix=None,
),
"burst": values.Value(
default="20/minute",
environ_name="BURST_THROTTLE_RATES",
environ_prefix=None,
),
},
}
SPECTACULAR_SETTINGS = {