Skip to content

Commit 00009ec

Browse files
committed
🔧(conf) add server to server api tokens to common
We have the e2e test "it creates a doc server way" that is quite complicated to run locally, because it requires the `DJANGO_SERVER_TO_SERVER_API_TOKENS` environment variable to be set in "env.d/development/common". We moved `DJANGO_SERVER_TO_SERVER_API_TOKENS` from "env.d/development/common.e2e.dist" to "env.d/development/common.dist", by doing so, this variable will be set by default in the "env.d/development/common" file, the test will now run without any additional configuration.
1 parent 9b0676e commit 00009ec

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

env.d/development/common.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,6 @@ COLLABORATION_SERVER_ORIGIN=http://localhost:3000
6262
COLLABORATION_SERVER_SECRET=my-secret
6363
COLLABORATION_WS_URL=ws://localhost:4444/collaboration/ws/
6464

65+
DJANGO_SERVER_TO_SERVER_API_TOKENS=server-api-token
6566
Y_PROVIDER_API_BASE_URL=http://y-provider-development:4444/api/
6667
Y_PROVIDER_API_KEY=yprovider-api-key

env.d/development/common.e2e.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# For the CI job test-e2e
22
BURST_THROTTLE_RATES="200/minute"
33
COLLABORATION_API_URL=http://y-provider:4444/collaboration/api/
4-
DJANGO_SERVER_TO_SERVER_API_TOKENS=test-e2e
54
SUSTAINED_THROTTLE_RATES="200/hour"
65
Y_PROVIDER_API_BASE_URL=http://y-provider:4444/api/

src/frontend/apps/e2e/__tests__/app-impress/doc-create.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ test.describe('Doc Create: Not logged', () => {
3939
browserName,
4040
request,
4141
}) => {
42+
const SERVER_TO_SERVER_API_TOKENS = 'server-api-token';
4243
const markdown = `This is a normal text\n\n# And this is a large heading`;
4344
const [title] = randomName('My server way doc create', browserName, 1);
4445
const data = {
@@ -53,7 +54,7 @@ test.describe('Doc Create: Not logged', () => {
5354
{
5455
data,
5556
headers: {
56-
Authorization: 'Bearer test-e2e',
57+
Authorization: `Bearer ${SERVER_TO_SERVER_API_TOKENS}`,
5758
format: 'json',
5859
},
5960
},

0 commit comments

Comments
 (0)