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

Switch to TestContainers for manging services in Playwright #28860

Merged
merged 40 commits into from
Jan 7, 2025

Conversation

t3chguy
Copy link
Member

@t3chguy t3chguy commented Jan 3, 2025

Requires #28876
Requires #28880

This PR ultimately simplifies things and gains support for more container runtimes but is not going to be pleasant to review. Trying to soften the blow with emphasising how nice it'll be to control/tweak services going forward:

Adding a synapse config option is now trivial and doesn't require duplicating a directory of Synapse configs with confusing placeholders:
image

Using a homeserver with smtp connection to mailhog:
image

Using a homeserver with consent required:
image

Spinning up arbitrary additional containers:
image

Improved logs access:
image

Uses docker internal networking for inter-container communication which simplifies configurations massively.

There is a small speed penalty for these benefits, but it is marginal and future work should offset it:

Before
image
After
image

Future work:

@t3chguy t3chguy added the T-Task Tasks for the team like planning label Jan 3, 2025
playwright/testcontainers/synapse.ts Dismissed Show dismissed Hide dismissed
playwright/testcontainers/synapse.ts Dismissed Show dismissed Hide dismissed
Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
…to t3chguy/playwright-testcontainers

Signed-off-by: Michael Telatynski <[email protected]>

# Conflicts:
#	playwright/plugins/docker/index.ts
#	playwright/plugins/homeserver/synapse/index.ts
#	playwright/plugins/mailhog/index.ts
#	playwright/plugins/matrix-authentication-service/index.ts
#	playwright/plugins/postgres/index.ts
#	playwright/plugins/sliding-sync-proxy/index.ts
Signed-off-by: Michael Telatynski <[email protected]>
* @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));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

playwright didn't like importing src/utils.ts so had to dupe this here

Signed-off-by: Michael Telatynski <[email protected]>
Base automatically changed from t3chguy/prepare-playwright-testcontainers to develop January 7, 2025 09:37
…to t3chguy/playwright-testcontainers

# Conflicts:
#	playwright/e2e/app-loading/guest-registration.spec.ts
#	playwright/e2e/crypto/dehydration.spec.ts
#	playwright/e2e/forgot-password/forgot-password.spec.ts
#	playwright/e2e/login/soft_logout.spec.ts
#	playwright/e2e/oidc/index.ts
#	playwright/e2e/register/email.spec.ts
#	playwright/e2e/register/register.spec.ts
#	playwright/plugins/homeserver/index.ts
#	playwright/plugins/homeserver/synapse/index.ts
#	playwright/plugins/homeserver/synapse/templates/mas-oidc/homeserver.yaml
#	playwright/plugins/matrix-authentication-service/config.yaml
#	playwright/plugins/matrix-authentication-service/index.ts
…to t3chguy/playwright-testcontainers

# Conflicts:
#	yarn.lock
@t3chguy t3chguy enabled auto-merge January 7, 2025 17:30
@t3chguy t3chguy added this pull request to the merge queue Jan 7, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 7, 2025
@t3chguy t3chguy added this pull request to the merge queue Jan 7, 2025
Merged via the queue into develop with commit f75d1f5 Jan 7, 2025
33 checks passed
@t3chguy t3chguy deleted the t3chguy/playwright-testcontainers branch January 7, 2025 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Task Tasks for the team like planning
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants