You've already forked element-web
mirror of
https://github.com/element-hq/element-web.git
synced 2025-08-09 14:42:51 +03:00
Use homeserver in a worker-scoped fixture (#28848)
* Use homeserver in a worker-scoped fixture Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Switch to TestContainers for manging services in Playwright Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Flip fixture dependency order Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Remove mas dep Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update matrix-authentication-service in Playwright tests Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * delint Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Fix SMTP port Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Comments Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Strip ansi from playwright logs to make them more readable Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Actually do the update Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Remove access to homeserver.config.baseUrl field in favour of homeserver.baseUrl Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Use sane default_server_config and specify server.invalid in the specific tests which demand it Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Fix mas run Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * break cycle Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * typo Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * prettier Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Wire up basics of dendriteHomeserver Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Fix types Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Discard changes to playwright/e2e/settings/device-management.spec.ts * Iterate Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Fix bad merge Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
committed by
GitHub
parent
3e27a0019d
commit
50ac509a01
@@ -12,37 +12,40 @@ import { TestContainers } from "testcontainers";
|
||||
import { Services } from "../../../services.ts";
|
||||
import { OAuthServer } from "../../oauth_server";
|
||||
|
||||
export const legacyOAuthHomeserver: Fixtures<Services, {}, Services> = {
|
||||
_homeserver: async ({ _homeserver: container }, use) => {
|
||||
const server = new OAuthServer();
|
||||
const port = server.start();
|
||||
export const legacyOAuthHomeserver: Fixtures<{}, Services> = {
|
||||
_homeserver: [
|
||||
async ({ _homeserver: container }, use) => {
|
||||
const server = new OAuthServer();
|
||||
const port = server.start();
|
||||
|
||||
await TestContainers.exposeHostPorts(port);
|
||||
container.withConfig({
|
||||
oidc_providers: [
|
||||
{
|
||||
idp_id: "test",
|
||||
idp_name: "OAuth test",
|
||||
issuer: `http://localhost:${port}/oauth`,
|
||||
authorization_endpoint: `http://localhost:${port}/oauth/auth.html`,
|
||||
// the token endpoint receives requests from synapse,
|
||||
// rather than the webapp, so needs to escape the docker container.
|
||||
token_endpoint: `http://host.testcontainers.internal:${port}/oauth/token`,
|
||||
userinfo_endpoint: `http://host.testcontainers.internal:${port}/oauth/userinfo`,
|
||||
client_id: "synapse",
|
||||
discover: false,
|
||||
scopes: ["profile"],
|
||||
skip_verification: true,
|
||||
client_auth_method: "none",
|
||||
user_mapping_provider: {
|
||||
config: {
|
||||
display_name_template: "{{ user.name }}",
|
||||
await TestContainers.exposeHostPorts(port);
|
||||
container.withConfig({
|
||||
oidc_providers: [
|
||||
{
|
||||
idp_id: "test",
|
||||
idp_name: "OAuth test",
|
||||
issuer: `http://localhost:${port}/oauth`,
|
||||
authorization_endpoint: `http://localhost:${port}/oauth/auth.html`,
|
||||
// the token endpoint receives requests from synapse,
|
||||
// rather than the webapp, so needs to escape the docker container.
|
||||
token_endpoint: `http://host.testcontainers.internal:${port}/oauth/token`,
|
||||
userinfo_endpoint: `http://host.testcontainers.internal:${port}/oauth/userinfo`,
|
||||
client_id: "synapse",
|
||||
discover: false,
|
||||
scopes: ["profile"],
|
||||
skip_verification: true,
|
||||
client_auth_method: "none",
|
||||
user_mapping_provider: {
|
||||
config: {
|
||||
display_name_template: "{{ user.name }}",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
await use(container);
|
||||
server.stop();
|
||||
},
|
||||
],
|
||||
});
|
||||
await use(container);
|
||||
server.stop();
|
||||
},
|
||||
{ scope: "worker" },
|
||||
],
|
||||
};
|
||||
|
Reference in New Issue
Block a user