Skip to content

Commit

Permalink
chore: roll folio to 0.3.6 (#4110)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgozman authored Oct 12, 2020
1 parent 80ed407 commit 46b14bc
Show file tree
Hide file tree
Showing 21 changed files with 774 additions and 789 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ jobs:
# XVFB-RUN merges both STDOUT and STDERR, whereas we need only STDERR
# Wrap `npm run` in a subshell to redirect STDERR to file.
# Enable core dumps in the subshell.
- run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- bash -c "ulimit -c unlimited && npx test-runner test/ --jobs=1 --forbid-only --timeout=30000 --global-timeout=5400000 --retries=3 --reporter=dot,json && npm run coverage"
- run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- bash -c "ulimit -c unlimited && npx folio test/ --workers=1 --forbid-only --timeout=30000 --global-timeout=5400000 --retries=3 --reporter=dot,json && npm run coverage"
env:
BROWSER: ${{ matrix.browser }}
PWRUNNER_JSON_REPORT: "test-results/report.json"
FOLIO_JSON_OUTPUT_NAME: "test-results/report.json"
- uses: actions/upload-artifact@v1
if: always()
with:
Expand All @@ -63,10 +63,10 @@ jobs:
- uses: microsoft/playwright-github-action@v1
- run: npm ci
- run: npm run build
- run: npx test-runner test/ --jobs=1 --forbid-only --timeout=30000 --global-timeout=5400000 --retries=3 --reporter=dot,json --shard=${{ matrix.shard }}/2
- run: npx folio test/ --workers=1 --forbid-only --timeout=30000 --global-timeout=5400000 --retries=3 --reporter=dot,json --shard=${{ matrix.shard }}/2
env:
BROWSER: ${{ matrix.browser }}
PWRUNNER_JSON_REPORT: "test-results/report.json"
FOLIO_JSON_OUTPUT_NAME: "test-results/report.json"
- uses: actions/upload-artifact@v1
if: ${{ always() }}
with:
Expand All @@ -91,11 +91,11 @@ jobs:
- uses: microsoft/playwright-github-action@v1
- run: npm ci
- run: npm run build
- run: npx test-runner test/ --jobs=1 --forbid-only --timeout=30000 --global-timeout=5400000 --retries=3 --reporter=dot,json
- run: npx folio test/ --workers=1 --forbid-only --timeout=30000 --global-timeout=5400000 --retries=3 --reporter=dot,json
shell: bash
env:
BROWSER: ${{ matrix.browser }}
PWRUNNER_JSON_REPORT: "test-results/report.json"
FOLIO_JSON_OUTPUT_NAME: "test-results/report.json"
- uses: actions/upload-artifact@v1
if: ${{ always() }}
with:
Expand Down Expand Up @@ -142,12 +142,12 @@ jobs:
# XVFB-RUN merges both STDOUT and STDERR, whereas we need only STDERR
# Wrap `npm run` in a subshell to redirect STDERR to file.
# Enable core dumps in the subshell.
- run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- bash -c "ulimit -c unlimited && npx test-runner test/ --jobs=1 --forbid-only --timeout=30000 --global-timeout=5400000 --retries=3 --reporter=dot,json"
- run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- bash -c "ulimit -c unlimited && npx folio test/ --workers=1 --forbid-only --timeout=30000 --global-timeout=5400000 --retries=3 --reporter=dot,json"
if: ${{ always() }}
env:
BROWSER: ${{ matrix.browser }}
HEADLESS: "false"
PWRUNNER_JSON_REPORT: "test-results/report.json"
FOLIO_JSON_OUTPUT_NAME: "test-results/report.json"
- uses: actions/upload-artifact@v1
if: ${{ always() }}
with:
Expand Down Expand Up @@ -175,11 +175,11 @@ jobs:
# XVFB-RUN merges both STDOUT and STDERR, whereas we need only STDERR
# Wrap `npm run` in a subshell to redirect STDERR to file.
# Enable core dumps in the subshell.
- run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- bash -c "ulimit -c unlimited && npx test-runner test/ --jobs=1 --forbid-only --timeout=30000 --global-timeout=5400000 --retries=3 --reporter=dot,json"
- run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- bash -c "ulimit -c unlimited && npx folio test/ --workers=1 --forbid-only --timeout=30000 --global-timeout=5400000 --retries=3 --reporter=dot,json"
env:
BROWSER: ${{ matrix.browser }}
PWWIRE: true
PWRUNNER_JSON_REPORT: "test-results/report.json"
FOLIO_JSON_OUTPUT_NAME: "test-results/report.json"
- uses: actions/upload-artifact@v1
if: ${{ always() }}
with:
Expand Down Expand Up @@ -207,11 +207,11 @@ jobs:
# XVFB-RUN merges both STDOUT and STDERR, whereas we need only STDERR
# Wrap `npm run` in a subshell to redirect STDERR to file.
# Enable core dumps in the subshell.
- run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- bash -c "ulimit -c unlimited && npx test-runner test/ --jobs=1 --forbid-only --timeout=60000 --global-timeout=5400000 --retries=3 --reporter=dot,json"
- run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- bash -c "ulimit -c unlimited && npx folio test/ --workers=1 --forbid-only --timeout=60000 --global-timeout=5400000 --retries=3 --reporter=dot,json"
env:
BROWSER: ${{ matrix.browser }}
TRACING: true
PWRUNNER_JSON_REPORT: "test-results/report.json"
FOLIO_JSON_OUTPUT_NAME: "test-results/report.json"
- uses: actions/upload-artifact@v1
if: ${{ always() }}
with:
Expand Down
78 changes: 39 additions & 39 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
"node": ">=10.17.0"
},
"scripts": {
"ctest": "cross-env BROWSER=chromium test-runner test/",
"ftest": "cross-env BROWSER=firefox test-runner test/",
"wtest": "cross-env BROWSER=webkit test-runner test/",
"test": "test-runner test/",
"ctest": "cross-env BROWSER=chromium folio test/",
"ftest": "cross-env BROWSER=firefox folio test/",
"wtest": "cross-env BROWSER=webkit folio test/",
"test": "folio test/",
"eslint": "[ \"$CI\" = true ] && eslint --quiet -f codeframe --ext js,ts . || eslint --ext js,ts .",
"tsc": "tsc -p .",
"tsc-installer": "tsc -p ./src/install/tsconfig.json",
"doc": "node utils/doclint/cli.js",
"test-infra": "test-runner utils/doclint/check_public_api/test/test.js && test-runner utils/doclint/preprocessor/test.js",
"test-infra": "folio utils/doclint/check_public_api/test/test.js && folio utils/doclint/preprocessor/test.js",
"lint": "npm run eslint && npm run tsc && npm run doc && npm run check-deps && npm run generate-channels && npm run test-types && npm run test-infra",
"clean": "rimraf lib && rimraf types",
"prepare": "node install-from-github.js",
Expand Down Expand Up @@ -50,7 +50,6 @@
"ws": "^7.3.1"
},
"devDependencies": {
"@playwright/test-runner": "0.9.22",
"@types/debug": "^4.1.5",
"@types/extract-zip": "^1.6.2",
"@types/mime": "^2.0.3",
Expand All @@ -69,6 +68,7 @@
"electron": "^9.2.1",
"eslint": "^7.7.0",
"eslint-plugin-notice": "^0.9.10",
"folio": "=0.3.6",
"formidable": "^1.2.2",
"ncp": "^2.0.0",
"node-stream-zip": "^1.11.3",
Expand Down
4 changes: 2 additions & 2 deletions test/browsertype-connect.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
* limitations under the License.
*/

import { serverFixtures } from './remoteServer.fixture';
import { folio } from './remoteServer.fixture';
import * as fs from 'fs';
const { it, expect, describe } = serverFixtures;
const { it, expect, describe } = folio;

describe('connect', (suite, { wire }) => {
suite.skip(wire);
Expand Down
28 changes: 11 additions & 17 deletions test/channels.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,20 @@
*/

import domain from 'domain';
import { fixtures as baseFixtures } from './fixtures';
import { folio } from './fixtures';
import type { ChromiumBrowser } from '..';

type DomainFixtures = {
domain: any;
};

const fixtures = baseFixtures.defineWorkerFixtures<DomainFixtures>({
domain: async ({ }, test) => {
const local = domain.create();
local.run(() => { });
let err;
local.on('error', e => err = e);
await test(null);
if (err)
throw err;
}
const fixtures = folio.extend<{ domain: any }, {}>();
fixtures.domain.initWorker(async ({ }, run) => {
const local = domain.create();
local.run(() => { });
let err;
local.on('error', e => err = e);
await run(null);
if (err)
throw err;
});

const { it, expect } = fixtures;
const { it, expect } = fixtures.build();

it('should work', async ({browser}) => {
expect(!!browser['_connection']).toBeTruthy();
Expand Down
22 changes: 10 additions & 12 deletions test/chromium/oopif.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,18 @@
* limitations under the License.
*/

import { fixtures as playwrightFixtures } from '../fixtures';
import { folio } from '../fixtures';

const fixtures = playwrightFixtures.overrideWorkerFixtures({
browser: async ({browserType, defaultBrowserOptions}, test) => {
const browser = await browserType.launch({
...defaultBrowserOptions,
args: (defaultBrowserOptions.args || []).concat(['--site-per-process'])
});
await test(browser);
await browser.close();
}
const fixtures = folio.extend();
fixtures.browser.overrideWorker(async ({browserType, defaultBrowserOptions}, run) => {
const browser = await browserType.launch({
...defaultBrowserOptions,
args: (defaultBrowserOptions.args || []).concat(['--site-per-process'])
});
await run(browser);
await browser.close();
});

const { it, expect, describe } = fixtures;
const { it, expect, describe } = fixtures.build();

describe('oopif', (suite, { browserName }) => {
suite.skip(browserName !== 'chromium');
Expand Down
12 changes: 5 additions & 7 deletions test/chromium/tracing.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,19 @@
* limitations under the License.
*/

import { fixtures as playwrightFixtures } from '../fixtures';
import { folio } from '../fixtures';
import fs from 'fs';
import path from 'path';
import type { ChromiumBrowser } from '../..';

type TestState = {
outputTraceFile: string;
};
const fixtures = playwrightFixtures.defineTestFixtures<TestState>({
outputTraceFile: async ({ testInfo }, test) => {
await test(testInfo.outputPath(path.join(`trace.json`)));
}
const fixtures = folio.extend<{}, TestState>();
fixtures.outputTraceFile.initTest(async ({ testInfo }, run) => {
await run(testInfo.outputPath(path.join(`trace.json`)));
});

const { it, expect, describe } = fixtures;
const { it, expect, describe } = fixtures.build();

describe('oopif', (suite, { browserName }) => {
suite.skip(browserName !== 'chromium');
Expand Down
Loading

0 comments on commit 46b14bc

Please sign in to comment.