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

feat: introduce docker integration #16382

Merged
merged 15 commits into from
Sep 9, 2022

Conversation

aslushnikov
Copy link
Collaborator

This patch introduces the following commands:

  • npx playwright install docker-image that builds a VRT docker image
    locally that is based off the mcr.microsoft.com/playwright:focal
  • npx playwright start-docker that launches a docker container with
    browsers.
  • npx playwright stop-docker that stops given docker container.
  • npx playwright test --docker that runs all the tests inside a
    launched docker container.

@rwoll
Copy link
Member

rwoll commented Aug 9, 2022

@aslushnikov When we add docs, make sure we tell people to increase default CPU and mem limit on their docker install (https://playwright.slack.com/archives/C01AG7QGW2F/p1659463173880389?thread_ts=1659428827.669649&cid=C01AG7QGW2F) otherwise they'll likely hit unexpected perf issues if they have a freshly installed Docker-for-Desktop.

@aslushnikov aslushnikov force-pushed the introduce-docker-integration branch from 5df033d to 8a9cb3d Compare August 9, 2022 16:29
@mxschmitt mxschmitt force-pushed the main branch 2 times, most recently from 34dd80c to 5578b86 Compare August 11, 2022 08:03
@rwoll
Copy link
Member

rwoll commented Aug 15, 2022

Can you add user docs (either directly here or in another PR) and then I'll review both docs and impl in one?

@aslushnikov aslushnikov force-pushed the introduce-docker-integration branch 2 times, most recently from c25c957 to 0a3e7ca Compare September 1, 2022 12:28
@aslushnikov aslushnikov force-pushed the introduce-docker-integration branch from 3b06d19 to add84ca Compare September 6, 2022 05:22
This patch introduces the following commands:
- `npx playwright docker build` that builds a VRT docker image
  locally that is based off the `mcr.microsoft.com/playwright:jammy`
- `npx playwright docker start` that launches a docker container with
  browsers.
- `npx playwright docker stop` that stops given docker container.
- `npx playwright docker test` that runs all the tests inside a
  launched docker container.
@aslushnikov aslushnikov force-pushed the introduce-docker-integration branch from ce77898 to c910a9b Compare September 8, 2022 16:10
@mxschmitt mxschmitt force-pushed the introduce-docker-integration branch from 55e96f2 to 7f20c79 Compare September 8, 2022 16:46
tests/installation/docker-integration.spec.ts Show resolved Hide resolved
packages/playwright-test/src/index.ts Outdated Show resolved Hide resolved
packages/playwright-test/src/index.ts Outdated Show resolved Hide resolved
packages/playwright-test/src/cli.ts Outdated Show resolved Hide resolved
packages/playwright-core/package.json Outdated Show resolved Hide resolved
packages/playwright-core/src/cli/docker.ts Outdated Show resolved Hide resolved
packages/playwright-core/src/cli/docker.ts Outdated Show resolved Hide resolved
packages/playwright-core/src/cli/docker.ts Outdated Show resolved Hide resolved
packages/playwright-core/src/cli/docker.ts Outdated Show resolved Hide resolved
packages/playwright-core/src/cli/docker.ts Outdated Show resolved Hide resolved
@aslushnikov
Copy link
Collaborator Author

Note for self: also add docker desktop recommended settings that @rwoll recommended

docs/src/docker.md Outdated Show resolved Hide resolved
docs/src/docker.md Outdated Show resolved Hide resolved
docs/src/docker.md Outdated Show resolved Hide resolved
docs/src/docker.md Outdated Show resolved Hide resolved
docs/src/docker.md Outdated Show resolved Hide resolved
docs/src/docker.md Outdated Show resolved Hide resolved
docs/src/docker.md Show resolved Hide resolved
packages/playwright-core/src/cli/docker.ts Outdated Show resolved Hide resolved
packages/playwright-core/src/cli/docker.ts Outdated Show resolved Hide resolved
utils/docker/Dockerfile.jammy Outdated Show resolved Hide resolved
});
});

test('make sure it tells to run `npx playwright docker build` when image is not instaleld', async ({ exec }) => {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
test('make sure it tells to run `npx playwright docker build` when image is not instaleld', async ({ exec }) => {
test('make sure it tells to run `npx playwright docker build` when image is not installed', async ({ exec }) => {

@aslushnikov aslushnikov merged commit af042be into microsoft:main Sep 9, 2022
@aslushnikov aslushnikov deleted the introduce-docker-integration branch September 9, 2022 22:25
aslushnikov added a commit that referenced this pull request Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants