From 3fe4fec11d1051feaa9b9b0b5a892693574980a1 Mon Sep 17 00:00:00 2001 From: Joel Einbinder Date: Mon, 27 Jan 2020 11:36:11 -0800 Subject: [PATCH 1/4] chore: windows bots via github actions --- .../{chromium.yml => chromium-linux.yml} | 2 +- .github/workflows/chromium-windows.yml | 32 +++++++++++++++++++ .../{firefox.yml => firefox-linux.yml} | 3 +- .github/workflows/firefox-windows.yml | 32 +++++++++++++++++++ .../{webkit.yml => webkit-linux.yml} | 3 +- .github/workflows/webkit-windows.yml | 32 +++++++++++++++++++ 6 files changed, 99 insertions(+), 5 deletions(-) rename .github/workflows/{chromium.yml => chromium-linux.yml} (95%) create mode 100644 .github/workflows/chromium-windows.yml rename .github/workflows/{firefox.yml => firefox-linux.yml} (93%) create mode 100644 .github/workflows/firefox-windows.yml rename .github/workflows/{webkit.yml => webkit-linux.yml} (96%) create mode 100644 .github/workflows/webkit-windows.yml diff --git a/.github/workflows/chromium.yml b/.github/workflows/chromium-linux.yml similarity index 95% rename from .github/workflows/chromium.yml rename to .github/workflows/chromium-linux.yml index fc2e6240de5f8..18fccf8865131 100644 --- a/.github/workflows/chromium.yml +++ b/.github/workflows/chromium-linux.yml @@ -1,4 +1,4 @@ -name: Chromium Tests +name: Chromium Linux Tests on: push: diff --git a/.github/workflows/chromium-windows.yml b/.github/workflows/chromium-windows.yml new file mode 100644 index 0000000000000..45a11fb24040d --- /dev/null +++ b/.github/workflows/chromium-windows.yml @@ -0,0 +1,32 @@ +name: Chromium Windows Tests + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build: + + runs-on: windows-latest + + strategy: + matrix: + node-version: [12.x] + + steps: + - uses: actions/checkout@v1 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: npm install, and test + run: | + npm install + npm run unit + env: + CI: true diff --git a/.github/workflows/firefox.yml b/.github/workflows/firefox-linux.yml similarity index 93% rename from .github/workflows/firefox.yml rename to .github/workflows/firefox-linux.yml index 463a70476179b..8e2e1375fd52a 100644 --- a/.github/workflows/firefox.yml +++ b/.github/workflows/firefox-linux.yml @@ -1,4 +1,4 @@ -name: Firefox Tests +name: Firefox Linux Tests on: push: @@ -30,7 +30,6 @@ jobs: - name: npm install, build, and test run: | npm install - npm run build xvfb-run --auto-servernum npm run funit env: CI: true diff --git a/.github/workflows/firefox-windows.yml b/.github/workflows/firefox-windows.yml new file mode 100644 index 0000000000000..03b9e1232149f --- /dev/null +++ b/.github/workflows/firefox-windows.yml @@ -0,0 +1,32 @@ +name: Firefox Windows Tests + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build: + + runs-on: windows-latest + + strategy: + matrix: + node-version: [12.x] + + steps: + - uses: actions/checkout@v1 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: npm install, and test + run: | + npm install + npm run funit + env: + CI: true diff --git a/.github/workflows/webkit.yml b/.github/workflows/webkit-linux.yml similarity index 96% rename from .github/workflows/webkit.yml rename to .github/workflows/webkit-linux.yml index 361306d567ca2..e8dc4a9495c4c 100644 --- a/.github/workflows/webkit.yml +++ b/.github/workflows/webkit-linux.yml @@ -1,4 +1,4 @@ -name: WebKit Tests +name: WebKit Linux Tests on: push: @@ -35,7 +35,6 @@ jobs: # The following logs LDD status of all webkit-wpe shared objects and executables. # pushd .local-webkit/$(ls .local-webkit)/minibrowser-wpe; ls -1 | grep -v pw_run.sh | LD_LIBRARY_PATH=$PWD xargs ldd; popd - npm run build xvfb-run --auto-servernum npm run wunit env: CI: true diff --git a/.github/workflows/webkit-windows.yml b/.github/workflows/webkit-windows.yml new file mode 100644 index 0000000000000..abd1ee65ef072 --- /dev/null +++ b/.github/workflows/webkit-windows.yml @@ -0,0 +1,32 @@ +name: WebKit Windows Tests + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build: + + runs-on: windows-latest + + strategy: + matrix: + node-version: [12.x] + + steps: + - uses: actions/checkout@v1 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: npm install, and test + run: | + npm install + npm run wunit + env: + CI: true From 6f7229bc6a5e371c21038eeee5a30a8cd24336fe Mon Sep 17 00:00:00 2001 From: Joel Einbinder Date: Tue, 28 Jan 2020 20:19:04 +0000 Subject: [PATCH 2/4] add gitattributes to fix line endings on windows bots --- .gitattributes | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000000..b8367b26b47d4 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +# .txt files must be lf for golden file tests to work +*.txt eol=lf + From 69cee8794bb5fdea6db0182152c3591e970ce4af Mon Sep 17 00:00:00 2001 From: Joel Einbinder Date: Tue, 28 Jan 2020 21:11:35 +0000 Subject: [PATCH 3/4] ftest, etc --- .cirrus.yml | 2 +- .gitattributes | 4 ++-- .github/workflows/chromium-linux.yml | 2 +- .github/workflows/chromium-windows.yml | 2 +- .github/workflows/firefox-linux.yml | 2 +- .github/workflows/firefox-windows.yml | 2 +- .github/workflows/webkit-linux.yml | 2 +- .github/workflows/webkit-windows.yml | 2 +- .travis.yml | 7 +++---- package.json | 14 +++++++------- test/chromium/headful.spec.js | 3 ++- test/launcher.spec.js | 6 +++--- 12 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 41ac3430a96be..b7f0975466f38 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -29,7 +29,7 @@ task: dockerfile: .ci/node8/Dockerfile.linux xvfb_start_background_script: Xvfb :99 -ac -screen 0 1024x768x24 install_script: npm install --unsafe-perm - test_script: npm run funit + test_script: npm run ftest task: osx_instance: diff --git a/.gitattributes b/.gitattributes index b8367b26b47d4..03d42ee974d86 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,3 @@ -# .txt files must be lf for golden file tests to work +# text files must be lf for golden file tests to work *.txt eol=lf - +*.json eol=lf diff --git a/.github/workflows/chromium-linux.yml b/.github/workflows/chromium-linux.yml index 18fccf8865131..7043d9bc4b481 100644 --- a/.github/workflows/chromium-linux.yml +++ b/.github/workflows/chromium-linux.yml @@ -31,6 +31,6 @@ jobs: run: | npm install npm run build - xvfb-run --auto-servernum npm run unit + xvfb-run --auto-servernum npm run ctest env: CI: true diff --git a/.github/workflows/chromium-windows.yml b/.github/workflows/chromium-windows.yml index 45a11fb24040d..bfc8f08a5f66e 100644 --- a/.github/workflows/chromium-windows.yml +++ b/.github/workflows/chromium-windows.yml @@ -27,6 +27,6 @@ jobs: - name: npm install, and test run: | npm install - npm run unit + npm run ctest env: CI: true diff --git a/.github/workflows/firefox-linux.yml b/.github/workflows/firefox-linux.yml index 8e2e1375fd52a..bf6a1548b2613 100644 --- a/.github/workflows/firefox-linux.yml +++ b/.github/workflows/firefox-linux.yml @@ -30,6 +30,6 @@ jobs: - name: npm install, build, and test run: | npm install - xvfb-run --auto-servernum npm run funit + xvfb-run --auto-servernum npm run ftest env: CI: true diff --git a/.github/workflows/firefox-windows.yml b/.github/workflows/firefox-windows.yml index 03b9e1232149f..0fc413be637b7 100644 --- a/.github/workflows/firefox-windows.yml +++ b/.github/workflows/firefox-windows.yml @@ -27,6 +27,6 @@ jobs: - name: npm install, and test run: | npm install - npm run funit + npm run ftest env: CI: true diff --git a/.github/workflows/webkit-linux.yml b/.github/workflows/webkit-linux.yml index e8dc4a9495c4c..c7ec50b0f3e69 100644 --- a/.github/workflows/webkit-linux.yml +++ b/.github/workflows/webkit-linux.yml @@ -35,6 +35,6 @@ jobs: # The following logs LDD status of all webkit-wpe shared objects and executables. # pushd .local-webkit/$(ls .local-webkit)/minibrowser-wpe; ls -1 | grep -v pw_run.sh | LD_LIBRARY_PATH=$PWD xargs ldd; popd - xvfb-run --auto-servernum npm run wunit + xvfb-run --auto-servernum npm run wtest env: CI: true diff --git a/.github/workflows/webkit-windows.yml b/.github/workflows/webkit-windows.yml index abd1ee65ef072..93523b0eff2a8 100644 --- a/.github/workflows/webkit-windows.yml +++ b/.github/workflows/webkit-windows.yml @@ -27,6 +27,6 @@ jobs: - name: npm install, and test run: | npm install - npm run wunit + npm run wtest env: CI: true diff --git a/.travis.yml b/.travis.yml index 0b08c3755b4f9..9d3709263031b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,11 +25,10 @@ cache: directories: - node_modules script: - - "npm run build" - "npm run lint" - - "xvfb-run --auto-servernum npm run unit" - - "xvfb-run --auto-servernum npm run funit" - - "xvfb-run --auto-servernum npm run wunit" + - "xvfb-run --auto-servernum npm run ctest" + - "xvfb-run --auto-servernum npm run ftest" + - "xvfb-run --auto-servernum npm run wtest" jobs: include: - node_js: "12" diff --git a/package.json b/package.json index 1befbb03b14c9..1ba88369cfc4a 100644 --- a/package.json +++ b/package.json @@ -13,18 +13,18 @@ "webkit_revision": "1113" }, "scripts": { - "unit": "node test/test.js", - "funit": "cross-env BROWSER=firefox node test/test.js", - "wunit": "cross-env BROWSER=webkit node test/test.js", - "debug-unit": "node --inspect-brk test/test.js", + "ctest": "cross-env BROWSER=chromium node test/test.js", + "ftest": "cross-env BROWSER=firefox node test/test.js", + "wtest": "cross-env BROWSER=webkit node test/test.js", + "debug-test": "node --inspect-brk test/test.js", "test-doclint": "node utils/doclint/check_public_api/test/test.js && node utils/doclint/preprocessor/test.js", "test": "npm run lint --silent && npm run coverage && npm run test-doclint && node utils/testrunner/test/test.js", "prepare": "node prepare.js", "lint": "([ \"$CI\" = true ] && eslint --quiet -f codeframe --ext js,ts ./src || eslint --ext js,ts ./src) && npm run tsc && npm run doc", "doc": "node utils/doclint/cli.js", - "coverage": "cross-env COVERAGE=true npm run unit", - "fcoverage": "cross-env COVERAGE=true BROWSER=firefox npm run unit", - "wcoverage": "cross-env COVERAGE=true BROWSER=webkit npm run unit", + "ccoverage": "cross-env COVERAGE=true npm run ctest", + "fcoverage": "cross-env COVERAGE=true BROWSER=firefox node test/test.js", + "wcoverage": "cross-env COVERAGE=true BROWSER=webkit node test/test.js", "tsc": "tsc -p .", "clean": "rimraf lib", "build": "node utils/runWebpack.js --mode='development' && tsc -p .", diff --git a/test/chromium/headful.spec.js b/test/chromium/headful.spec.js index 15ea7ca6f2054..327947ab2a85d 100644 --- a/test/chromium/headful.spec.js +++ b/test/chromium/headful.spec.js @@ -67,7 +67,8 @@ module.exports.describe = function({testRunner, expect, playwright, defaultBrows expect(pages).toEqual(['about:blank']); await browser.close(); }); - it('headless should be able to read cookies written by headful', async({server}) => { + // see https://github.com/microsoft/playwright/issues/717 + it.skip(WIN && CHROMIUM)('headless should be able to read cookies written by headful', async({server}) => { const userDataDir = await mkdtempAsync(TMP_FOLDER); // Write a cookie in headful chrome const headfulBrowser = await playwright.launch(Object.assign({userDataDir}, headfulOptions)); diff --git a/test/launcher.spec.js b/test/launcher.spec.js index f0fe24fa461b2..c5cd1c5ee2314 100644 --- a/test/launcher.spec.js +++ b/test/launcher.spec.js @@ -26,7 +26,7 @@ const mkdtempAsync = util.promisify(fs.mkdtemp); const TMP_FOLDER = path.join(os.tmpdir(), 'pw_tmp_folder-'); -module.exports.describe = function({testRunner, expect, defaultBrowserOptions, playwright, playwrightPath, product, CHROMIUM, FFOX, WEBKIT}) { +module.exports.describe = function({testRunner, expect, defaultBrowserOptions, playwright, playwrightPath, product, CHROMIUM, FFOX, WEBKIT, WIN}) { const {describe, xdescribe, fdescribe} = testRunner; const {it, fit, xit, dit} = testRunner; const {beforeAll, beforeEach, afterAll, afterEach} = testRunner; @@ -342,8 +342,8 @@ module.exports.describe = function({testRunner, expect, defaultBrowserOptions, p // This might throw. See https://github.com/GoogleChrome/puppeteer/issues/2778 await rmAsync(userDataDir).catch(e => {}); }); - // This mysteriously fails on Windows on AppVeyor. See https://github.com/GoogleChrome/puppeteer/issues/4111 - it.skip(FFOX)('userDataDir option should restore cookies', async({server}) => { + // See https://github.com/microsoft/playwright/issues/717 + it.skip(FFOX || (WIN && CHROMIUM))('userDataDir option should restore cookies', async({server}) => { const userDataDir = await mkdtempAsync(TMP_FOLDER); const options = Object.assign({userDataDir}, defaultBrowserOptions); const browser = await playwright.launch(options); From 22e7796b83e11bc16d66b19a88a50d0af94a34d0 Mon Sep 17 00:00:00 2001 From: Joel Einbinder Date: Tue, 28 Jan 2020 21:16:07 +0000 Subject: [PATCH 4/4] syntax error in headful.spec.js --- test/chromium/headful.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/chromium/headful.spec.js b/test/chromium/headful.spec.js index 327947ab2a85d..4aa4b9a574767 100644 --- a/test/chromium/headful.spec.js +++ b/test/chromium/headful.spec.js @@ -24,7 +24,7 @@ const mkdtempAsync = util.promisify(fs.mkdtemp); const TMP_FOLDER = path.join(os.tmpdir(), 'pw_tmp_folder-'); -module.exports.describe = function({testRunner, expect, playwright, defaultBrowserOptions, FFOX, CHROMIUM, WEBKIT}) { +module.exports.describe = function({testRunner, expect, playwright, defaultBrowserOptions, FFOX, CHROMIUM, WEBKIT, WIN}) { const {describe, xdescribe, fdescribe} = testRunner; const {it, fit, xit, dit} = testRunner; const {beforeAll, beforeEach, afterAll, afterEach} = testRunner;