Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use homeserver in a worker-scoped fixture #28848

Merged
merged 52 commits into from
Jan 8, 2025
Merged
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
bba55a7
Use homeserver in a worker-scoped fixture
t3chguy Jan 2, 2025
c3316a8
Iterate
t3chguy Jan 2, 2025
0764106
Iterate
t3chguy Jan 2, 2025
00b25f5
Switch to TestContainers for manging services in Playwright
t3chguy Jan 3, 2025
87a0acb
Iterate
t3chguy Jan 3, 2025
7ba1d3e
Flip fixture dependency order
t3chguy Jan 3, 2025
c0337f1
Remove mas dep
t3chguy Jan 6, 2025
a4ba79a
Iterate
t3chguy Jan 6, 2025
94697fe
Iterate
t3chguy Jan 6, 2025
9c52986
Iterate
t3chguy Jan 6, 2025
f176473
Iterate
t3chguy Jan 6, 2025
75ba4f2
Iterate
t3chguy Jan 6, 2025
99af4a4
Merge branch 'develop' of https://github.com/vector-im/element-web in…
t3chguy Jan 6, 2025
4fce001
Iterate
t3chguy Jan 6, 2025
4eefa27
Update matrix-authentication-service in Playwright tests
t3chguy Jan 6, 2025
1cd1dcd
delint
t3chguy Jan 6, 2025
f1c392d
Fix SMTP port
t3chguy Jan 6, 2025
84126e8
Iterate
t3chguy Jan 6, 2025
eaca3f8
Comments
t3chguy Jan 6, 2025
edefe02
Strip ansi from playwright logs to make them more readable
t3chguy Jan 6, 2025
d506dec
Actually do the update
t3chguy Jan 6, 2025
63e855e
Iterate
t3chguy Jan 6, 2025
8e1372b
Remove access to homeserver.config.baseUrl field in favour of homeser…
t3chguy Jan 6, 2025
d80ad9d
Use sane default_server_config and specify server.invalid in the spec…
t3chguy Jan 6, 2025
4cacb83
Fix mas run
t3chguy Jan 6, 2025
08bb07e
break cycle
t3chguy Jan 6, 2025
7104429
Merge branch 't3chguy/playwright-update-mas' of https://github.com/ve…
t3chguy Jan 6, 2025
e7b62c3
Merge branch 't3chguy/prepare-playwright-testcontainers' of https://g…
t3chguy Jan 6, 2025
f6ea850
Iterate
t3chguy Jan 6, 2025
b2fb036
typo
t3chguy Jan 6, 2025
1368dc0
Iterate
t3chguy Jan 6, 2025
27652d0
Iterate
t3chguy Jan 6, 2025
ac53bab
Merge branch 'develop' of https://github.com/vector-im/element-web in…
t3chguy Jan 6, 2025
69723c5
Merge branch 't3chguy/prepare-playwright-testcontainers' of https://g…
t3chguy Jan 6, 2025
9ba9f1c
Iterate
t3chguy Jan 6, 2025
ea61320
prettier
t3chguy Jan 6, 2025
7ceced6
Merge branch 'develop' of https://github.com/vector-im/element-web in…
t3chguy Jan 6, 2025
fd44732
Merge branch 't3chguy/prepare-playwright-testcontainers' of https://g…
t3chguy Jan 6, 2025
0410574
Wire up basics of dendriteHomeserver
t3chguy Jan 6, 2025
96d1812
Merge branch 'develop' of https://github.com/vector-im/element-web in…
t3chguy Jan 7, 2025
6e6c70f
Merge branch 't3chguy/playwright-testcontainers' of https://github.co…
t3chguy Jan 7, 2025
90a05cd
Iterate
t3chguy Jan 7, 2025
0785dec
Iterate
t3chguy Jan 7, 2025
36b8d3c
Iterate
t3chguy Jan 7, 2025
dd494dc
Fix types
t3chguy Jan 7, 2025
a29956e
Iterate
t3chguy Jan 7, 2025
f770ba6
Iterate
t3chguy Jan 7, 2025
da0b0c9
Discard changes to playwright/e2e/settings/device-management.spec.ts
t3chguy Jan 7, 2025
c2682a3
Merge branch 'develop' of https://github.com/vector-im/element-web in…
t3chguy Jan 8, 2025
b346763
Merge branch 't3chguy/worker-scoped-fixtures' of https://github.com/v…
t3chguy Jan 8, 2025
ca7c303
Iterate
t3chguy Jan 8, 2025
70aa6e1
Fix bad merge
t3chguy Jan 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Iterate
Signed-off-by: Michael Telatynski <[email protected]>
  • Loading branch information
t3chguy committed Jan 3, 2025
commit 87a0acb53aa6ba1f9ccb203b2fc62b9df949a5dc
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -190,7 +190,6 @@
"@types/escape-html": "^1.0.1",
"@types/express": "^5.0.0",
"@types/file-saver": "^2.0.3",
"@types/fs-extra": "^11.0.0",
"@types/glob-to-regexp": "^0.4.1",
"@types/jest": "29.5.12",
"@types/jitsi-meet": "^2.0.2",
@@ -242,7 +241,6 @@
"fetch-mock": "9.11.0",
"fetch-mock-jest": "^1.5.1",
"file-loader": "^6.0.0",
"fs-extra": "^11.0.0",
"glob": "^11.0.0",
"html-webpack-plugin": "^5.5.3",
"husky": "^9.0.0",
3 changes: 1 addition & 2 deletions playwright/e2e/login/utils.ts
Original file line number Diff line number Diff line change
@@ -6,10 +6,9 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
*/

import { Page, expect, Fixtures } from "@playwright/test";
import { Page, expect } from "@playwright/test";

import { Credentials, HomeserverInstance } from "../../plugins/homeserver";
import { Services } from "../../services.ts";

/** Visit the login page, choose to log in with "OAuth test", register a new account, and redirect back to Element
*/
16 changes: 16 additions & 0 deletions playwright/plugins/utils/object.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
Copyright 2024 New Vector Ltd.

SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
*/

/**
* Deep copy the given object. The object MUST NOT have circular references and
* MUST NOT have functions.
* @param obj - The object to deep copy.
* @returns A copy of the object without any references to the original.
*/
export function deepCopy<T>(obj: T): T {
return JSON.parse(JSON.stringify(obj));
}
2 changes: 1 addition & 1 deletion playwright/testcontainers/dendrite.ts
Original file line number Diff line number Diff line change
@@ -8,12 +8,12 @@ Please see LICENSE files in the repository root for full details.
import { GenericContainer, Wait } from "testcontainers";
import { APIRequestContext } from "@playwright/test";
import * as YAML from "yaml";
import { deepCopy } from "matrix-js-sdk/src/utils";
import { set } from "lodash";

import { getFreePort } from "../plugins/utils/port.ts";
import { randB64Bytes } from "../plugins/utils/rand.ts";
import { StartedSynapseContainer } from "./synapse.ts";
import { deepCopy } from "../plugins/utils/object.ts";

const DEFAULT_CONFIG = {
version: 2,
6 changes: 2 additions & 4 deletions playwright/testcontainers/mas.ts
Original file line number Diff line number Diff line change
@@ -5,13 +5,11 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
Please see LICENSE files in the repository root for full details.
*/

import { AbstractStartedContainer, GenericContainer, StartedTestContainer, Wait } from "testcontainers";
import crypto from "node:crypto";
import { GenericContainer, StartedTestContainer, Wait } from "testcontainers";
import * as YAML from "yaml";

import { getFreePort } from "../plugins/utils/port.ts";
import { Credentials } from "../plugins/homeserver";
import { deepCopy } from "matrix-js-sdk/src/utils.ts";
import { deepCopy } from "../plugins/utils/object.ts";

const DEFAULT_CONFIG = {
http: {
2 changes: 1 addition & 1 deletion playwright/testcontainers/synapse.ts
Original file line number Diff line number Diff line change
@@ -9,12 +9,12 @@ import { AbstractStartedContainer, GenericContainer, StartedTestContainer, Wait
import { APIRequestContext } from "@playwright/test";
import crypto from "node:crypto";
import * as YAML from "yaml";
import { deepCopy } from "matrix-js-sdk/src/utils";
import { set } from "lodash";

import { getFreePort } from "../plugins/utils/port.ts";
import { randB64Bytes } from "../plugins/utils/rand.ts";
import { Credentials, HomeserverInstance } from "../plugins/homeserver";
import { deepCopy } from "../plugins/utils/object.ts";

const TAG = "develop@sha256:17cc0a301447430624afb860276e5c13270ddeb99a3f6d1c6d519a20b1a8f650";

40 changes: 1 addition & 39 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -2939,14 +2939,6 @@
resolved "https://registry.yarnpkg.com/@types/file-saver/-/file-saver-2.0.7.tgz#8dbb2f24bdc7486c54aa854eb414940bbd056f7d"
integrity sha512-dNKVfHd/jk0SkR/exKGj2ggkB45MAkzvWCaqLUUgkyjITkGNzH8H+yUwr+BLJUBjZOe9w8X3wgmXhZDRg1ED6A==

"@types/fs-extra@^11.0.0":
version "11.0.4"
resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-11.0.4.tgz#e16a863bb8843fba8c5004362b5a73e17becca45"
integrity sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==
dependencies:
"@types/jsonfile" "*"
"@types/node" "*"

"@types/[email protected]":
version "3.2.5"
resolved "https://registry.yarnpkg.com/@types/geojson-vt/-/geojson-vt-3.2.5.tgz#b6c356874991d9ab4207533476dfbcdb21e38408"
@@ -3047,13 +3039,6 @@
resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee"
integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==

"@types/jsonfile@*":
version "6.1.4"
resolved "https://registry.yarnpkg.com/@types/jsonfile/-/jsonfile-6.1.4.tgz#614afec1a1164e7d670b4a7ad64df3e7beb7b702"
integrity sha512-D5qGUYwjvnNNextdU59/+fI+spnwtTFmyQP0h+PfIOSkNfpU6AOICUOkm4i0OnSk+NyjdPJrxCDro0sJsWlRpQ==
dependencies:
"@types/node" "*"

"@types/jsrsasign@^10.5.4":
version "10.5.15"
resolved "https://registry.yarnpkg.com/@types/jsrsasign/-/jsrsasign-10.5.15.tgz#5cf1ee506b2fa2435b6e1786a873285c7110eb82"
@@ -6504,15 +6489,6 @@ fs-constants@^1.0.0:
resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad"
integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==

fs-extra@^11.0.0:
version "11.2.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.2.0.tgz#e70e17dfad64232287d01929399e0ea7c86b0e5b"
integrity sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==
dependencies:
graceful-fs "^4.2.0"
jsonfile "^6.0.1"
universalify "^2.0.0"

fs.realpath@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
@@ -6798,7 +6774,7 @@ gopd@^1.1.0:
dependencies:
get-intrinsic "^1.2.4"

graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.11, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9:
graceful-fs@^4.1.2, graceful-fs@^4.2.0, graceful-fs@^4.2.11, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9:
version "4.2.11"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3"
integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==
@@ -8129,15 +8105,6 @@ json5@^2.1.2, json5@^2.1.3, json5@^2.2.3:
resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283"
integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==

jsonfile@^6.0.1:
version "6.1.0"
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae"
integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==
dependencies:
universalify "^2.0.0"
optionalDependencies:
graceful-fs "^4.1.6"

jsqr@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/jsqr/-/jsqr-1.4.0.tgz#8efb8d0a7cc6863cb6d95116b9069123ce9eb2d1"
@@ -12062,11 +12029,6 @@ universalify@^0.2.0:
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0"
integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==

universalify@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.1.tgz#168efc2180964e6386d061e094df61afe239b18d"
integrity sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==

[email protected], unpipe@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"
Loading