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.

@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
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.
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.

None yet

4 participants