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

chore: windows bots via github actions #678

Merged
merged 4 commits into from
Jan 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# text files must be lf for golden file tests to work
*.txt eol=lf
*.json eol=lf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Chromium Tests
name: Chromium Linux Tests

on:
push:
Expand Down Expand Up @@ -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
32 changes: 32 additions & 0 deletions .github/workflows/chromium-windows.yml
Original file line number Diff line number Diff line change
@@ -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 ctest
env:
CI: true
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Firefox Tests
name: Firefox Linux Tests

on:
push:
Expand Down Expand Up @@ -30,7 +30,6 @@ jobs:
- name: npm install, build, and test
run: |
npm install
npm run build
xvfb-run --auto-servernum npm run funit
xvfb-run --auto-servernum npm run ftest
env:
CI: true
32 changes: 32 additions & 0 deletions .github/workflows/firefox-windows.yml
Original file line number Diff line number Diff line change
@@ -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 ftest
env:
CI: true
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: WebKit Tests
name: WebKit Linux Tests

on:
push:
Expand Down Expand Up @@ -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
xvfb-run --auto-servernum npm run wtest
env:
CI: true
32 changes: 32 additions & 0 deletions .github/workflows/webkit-windows.yml
Original file line number Diff line number Diff line change
@@ -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 wtest
env:
CI: true
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Copy link
Contributor

Choose a reason for hiding this comment

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

npm test is failing:

> playwright-core@0.11.1-post test /Users/aes/sandbox/playwright
> npm run lint --silent && npm run coverage && npm run test-doclint && node utils/testrunner/test/test.js

0 failures, 0 warnings.
DocLint Finished in 7.388 seconds
npm ERR! missing script: coverage
npm ERR! 
npm ERR! Did you mean one of these?
npm ERR!     ccoverage
npm ERR!     fcoverage
npm ERR!     wcoverage

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/aes/.npm/_logs/2020-02-18T23_57_11_890Z-debug.log
npm ERR! Test failed.  See above for more details.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should test script be changed to:

    "test": "npm run lint --silent && npm run ccoverage && npm run test-doclint && node utils/testrunner/test/test.js",

@JoelEinbinder

"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 .",
Expand Down
5 changes: 3 additions & 2 deletions test/chromium/headful.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
Expand Down
6 changes: 3 additions & 3 deletions test/launcher.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down