Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 2fb0d13

Browse files
authored
Update e2e CI and docs (#182)
* update READMEs Signed-off-by: Kim Brose <kim.brose@nordeck.net> * fix e2e testing Dockerfile syntax Signed-off-by: Kim Brose <kim.brose@nordeck.net> * update upstream element web repo path Signed-off-by: Kim Brose <kim.brose@nordeck.net> * add widget toggles module to e2e test container Signed-off-by: Kim Brose <kim.brose@nordeck.net> * use latest element web and synapse releases for e2e Signed-off-by: Kim Brose <kim.brose@nordeck.net> * document required ingress for synapse guest module Signed-off-by: Kim Brose <kim.brose@nordeck.net> --------- Signed-off-by: Kim Brose <kim.brose@nordeck.net>
1 parent 03b8374 commit 2fb0d13

File tree

9 files changed

+31
-14
lines changed

9 files changed

+31
-14
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,12 @@ You need to install Node.js (`>= 20.0.0`, prefer using an LTS version) and run
4949

5050
After checkout, run `yarn install` to download the required dependencies
5151

52-
> **Warning** Do not use `npm install` when working with this package.
52+
> [!WARNING]
53+
> Do not use `npm install` when working with this package.
5354
5455
### Available Scripts
5556

56-
In the project directory, you can run:
57+
In the project root directory, you can run:
5758

5859
- `yarn build`: Build the production version of the modules.
5960
- `yarn test`: Watch all files for changes and run tests.

e2e/README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,17 @@ Running the e2e tests requires Docker or Podman to be installed.
1010

1111
If using Podman be sure to [set up the `DOCKER_HOST` environment variable](https://node.testcontainers.org/supported-container-runtimes/).
1212

13+
Run `yarn playwright install` or similar to install playwright and download the browser engines.
14+
1315
### Running Tests
1416

15-
The e2e tests are testing the guest module for Element and for Synapse.
17+
The e2e tests are testing the modules for Element and guest module for Synapse.
1618
Make sure to always run `yarn e2e:build` in the root folder before initially running the tests or after changing a component.
1719

1820
1. **Synapse Module**: By default, it uses the image that was built by running `yarn docker:build` in the root folder of this repository.
1921
Building the container at least once is required to run the tests.
2022
Alternatively, you can set the `MODULE_CONTAINER_IMAGE` environment variable to use a custom container image for the Synapse Guest Module.
21-
2. **Element Module**: It uses the module that is packaged by `yarn build`.
22-
Only run this if there are actual changes in the module to not
23+
2. **Element Modules**: It uses the modules that are packaged by `yarn build`, which is automatically called by `yarn e2e:build`.
2324

2425
Afterwards you can run `yarn e2e` to perform the tests.
2526

@@ -31,9 +32,12 @@ If you encounter this message, make sure to install the Browsers via `npx playwr
3132

3233
### Available Scripts
3334

34-
In the project directory, you can run:
35+
In the repository root directory, you can run:
3536

3637
- `yarn build`: Run all required build steps for the e2e tests to run.
37-
- `yarn lint`: Run eslint on the tests.
38+
39+
In the repository root or the e2e project directory, you can run:
40+
41+
- `yarn lint`: Run eslint, scoped to everything or just the tests respectively.
3842
- `yarn depcheck`: Check for missing or unused dependencies.
3943
- `yarn e2e`: Runs the end-to-end tests in a single browser. Pass `--debug` to enable the debug UI. Pass `--ui` to enable the Playwright UI Mode.

e2e/src/deploy/elementWeb/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
FROM node:20-bullseye as builder
1+
FROM node:20-bullseye AS builder
22

3-
ARG ELEMENT_VERSION="v1.11.84"
3+
ARG ELEMENT_VERSION="master"
44

55
WORKDIR /src
66

77
# Clone the release tag from element
8-
RUN git clone --depth 1 --branch $ELEMENT_VERSION https://github.com/vector-im/element-web.git /src
8+
RUN git clone --depth 1 --branch $ELEMENT_VERSION https://github.com/element-hq/element-web.git /src
99

1010
RUN yarn --network-timeout=200000 install
1111

e2e/src/deploy/elementWeb/build_config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ modules:
33
- 'file:nordeck-element-web-guest-module.tgz'
44
- 'file:nordeck-element-web-opendesk-module.tgz'
55
- 'file:nordeck-element-web-widget-lifecycle-module.tgz'
6+
- 'file:nordeck-element-web-widget-toggles-module.tgz'

e2e/src/deploy/elementWeb/config.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,10 @@
7575
]
7676
}
7777
}
78+
},
79+
"net.nordeck.element_web.module.widget_toggles": {
80+
"config": {
81+
"types": ["jitsi", "net.nordeck.*"]
82+
}
7883
}
7984
}

e2e/src/deploy/elementWeb/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ let container: StartedTestContainer | undefined;
2222
export async function startElementWeb({
2323
homeserverUrl,
2424
widgetServerUrl,
25-
version = 'v1.11.84',
25+
version = 'master',
2626
}: {
2727
homeserverUrl: string;
2828
widgetServerUrl: string;

e2e/src/deploy/synapse/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function randB64Bytes(numBytes: number): string {
2727
}
2828

2929
export async function startSynapse({
30-
containerImage = 'matrixdotorg/synapse:v1.90.0',
30+
containerImage = 'matrixdotorg/synapse:latest',
3131
moduleContainerImage = 'nordeck/synapse-guest-module',
3232
}: { containerImage?: string; moduleContainerImage?: string } = {}): Promise<{
3333
synapseUrl: string;

packages/element-web-widget-lifecycle-module/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ But these security features can lower the usability especially in more integrate
2828
This module was initially created to pre-approve capabilities and permission requests from the widgets if they were added by [NeoDateFix](https://github.com/nordeck/matrix-meetings) so the users are not always asked for permission in every meeting room.
2929
It allows you to selectively skip the permission dialogs for widgets that you trust, while they still appear for widgets that were added by third parties.
3030

31-
> ⚠️ We recommend to only approve widgets that you deployed yourselves. These features should protect your users and you should only disable them for widgets that you trust!
31+
> [!WARNING]
32+
> We recommend to only approve widgets that you deployed yourselves. These features should protect your users and you should only disable them for widgets that you trust!
3233
3334
## Requirements
3435

packages/synapse-guest-module/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ The module is not published to a python registry, but we provide a docker contai
6464
# ...
6565
template:
6666
spec:
67-
+ # The init container copies the module to he `synapse-modules` volume
67+
+ # The init container copies the module to the `synapse-modules` volume
6868
+ initContainers:
6969
+ - image: ghcr.io/nordeck/synapse-guest-module:<version>
7070
+ name: install-guest-module
@@ -91,3 +91,8 @@ The module is not published to a python registry, but we provide a docker contai
9191
+ name: synapse-modules
9292
# ...
9393
```
94+
95+
## Ingress/TLS proxy configuration
96+
97+
The module exposes a new REST API POST endpoint at `/_synapse/client/register_guest`.
98+
Any Ingress or other proxying software used must therefore forward this path to synapse.

0 commit comments

Comments
 (0)