Merge branch 'master' of github.com:microsoft/playwright

This commit is contained in:
Dmitry Gozman 2019-11-22 18:55:39 -08:00
Родитель fd1cb2b5a0 53eddc1c14
Коммит 52f2f45438
2 изменённых файлов: 136 добавлений и 0 удалений

63
browser_patches/bots.md Normal file
Просмотреть файл

@ -0,0 +1,63 @@
# Setting Up Build Bots
This document describes setting up bots infrastructure to produce
browser builds.
We currently have 4 build bots that produce 6 builds
- **[bot-linux]** Ubuntu 18.04 machine
- builds: `Webkit-Linux`, `Firefox-Linux`
- **[bot-mac-10.14]** Mac 10.14 machine
- builds: `WebKit-mac-10.14`, `Firefox-Mac`
- **[bot-mac-10.15]** machine
- builds: `WebKit-mac-10.15`
- **[bot-windows]** Windows machine
- builds: `Firefox-win32`
# bot-windows
## Setting Up Host Machine
### 1. Prepare machine to compile firefox
Follow instructions on [Building Firefox for Windows](https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Windows_Prerequisites). Get the checkout with mercurial and run "./mach bootstrap" from mercurial root.
After this step, you should have `c:\mozilla-build` folder
and `c:\mozilla-source` folder with firefox checkout.
> **NOTE:** No spaces or quotes are allowed here!
### 2. Install azure-cli
Install [azure-cli](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-windows?view=azure-cli-latest) for windows using MS Installer
### 3. Export "az" to the mingw world
Run `cmd` as administrator and run the following line:
```
> echo cmd.exe /c "\"C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.cmd\" $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} ${14} ${15} ${16}" > "%SYSTEMROOT%\az"
```
This command will create a `c:\Windows\az` file that will call azure-cli with passed parameters (Not the most beautiful solution, but it works!)
### 4. Provide CDN credentials to mingw env
Edit `c:\mozilla-build\start-shell.bat` and add two lines in the beginning:
```bat
SET AZ_ACCOUNT_NAME=<account-name>
SET AZ_ACCOUNT_KEY=<account-key>
```
change `<account-name>` and `<account-key>` with relevant keys/names.
### 5. Checkout PlayWright to /c/
Run `c:\mozilla-build\start-shell.bat` and checkout PlayWright repo to `/c/playwright`.
## Running Build Loop
1. Launch `c:\mozilla-build/start-shell.bat`
2. Run `/c/playwright/browser_patches/tools/poll_build.sh`

Просмотреть файл

@ -0,0 +1,73 @@
# Contributing Browser Patches
Firefox and WebKit have additional patches atop to expose necessary capabilities.
Ideally, all these changes should be upstreamed.
For the time being, it is possible to setup a browser checkout
and develop from there.
## 1. Setting up local browser checkout
From the `playwright` repo, run the following command:
```sh
$ ./browser_patches/prepare_checkout.sh firefox
```
(you can optionally pass "webkit" for a webkit checkout)
> **NOTE:** this command downloads GBs of data.
This command will:
- create a git browser checkout at `./browser_patches/firefox/checkout`
- create a `browser_upstream` remote in the checkout
- create a `playwright-build` branch and apply all playwright-required patches to it.
## 2. Developing a new change
You want to create a new branch off the `playwright-build` branch.
Assuming that you're under `./browser_patches/firefox/checkout`:
```sh
$ git checkout -b my-new-feature playwright-build
$ # develop my feature on the my-new-feature branch ....
```
## 3. Exporting your change to playwright repo
Once you're happy with the work you did in the browser-land, you want to export it to the `playwright` repo.
Assuming that you're in the root of the `playwright` repo and that your browser checkout has your feature branch checked out:
```sh
$ ./browser_patches/export.sh firefox
```
This script will:
- create a new patch and put it to the `./browser_patches/firefox/patches/`
- update the `./browser_patches/firefox/UPSTREAM_CONFIG.sh` if necessary
- bump the `./browser_patches/firefox/BUILD_NUMBER` number.
Send a PR to the PlayWright repo to be reviewed.
## 4. Rolling PlayWright to the new browser build
Once the patch has been committed, the build bots will kick in, compile and upload a new browser version to all the platforms.
You can check the CDN status:
```sh
$ ./browser_patches/tools/check_cdn.sh
```
As the builds appear, you can roll to a new browser version in the `./package.json` file.
# FAQ
## Q: Can I reuse my other browser checkout?
Yes, you can. For this:
- pass path to your browser checkout as a second argument to `prepare_checkout.sh` script.
- pass path to your browser checkout as a second argument to `export.sh` when exporting changes.