Skip to content

Commit 46b14bc

Browse files
authored
chore: roll folio to 0.3.6 (#4110)
1 parent 80ed407 commit 46b14bc

21 files changed

+774
-789
lines changed

.github/workflows/tests.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ jobs:
3737
# XVFB-RUN merges both STDOUT and STDERR, whereas we need only STDERR
3838
# Wrap `npm run` in a subshell to redirect STDERR to file.
3939
# Enable core dumps in the subshell.
40-
- 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"
40+
- 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"
4141
env:
4242
BROWSER: ${{ matrix.browser }}
43-
PWRUNNER_JSON_REPORT: "test-results/report.json"
43+
FOLIO_JSON_OUTPUT_NAME: "test-results/report.json"
4444
- uses: actions/upload-artifact@v1
4545
if: always()
4646
with:
@@ -63,10 +63,10 @@ jobs:
6363
- uses: microsoft/playwright-github-action@v1
6464
- run: npm ci
6565
- run: npm run build
66-
- run: npx test-runner test/ --jobs=1 --forbid-only --timeout=30000 --global-timeout=5400000 --retries=3 --reporter=dot,json --shard=${{ matrix.shard }}/2
66+
- run: npx folio test/ --workers=1 --forbid-only --timeout=30000 --global-timeout=5400000 --retries=3 --reporter=dot,json --shard=${{ matrix.shard }}/2
6767
env:
6868
BROWSER: ${{ matrix.browser }}
69-
PWRUNNER_JSON_REPORT: "test-results/report.json"
69+
FOLIO_JSON_OUTPUT_NAME: "test-results/report.json"
7070
- uses: actions/upload-artifact@v1
7171
if: ${{ always() }}
7272
with:
@@ -91,11 +91,11 @@ jobs:
9191
- uses: microsoft/playwright-github-action@v1
9292
- run: npm ci
9393
- run: npm run build
94-
- run: npx test-runner test/ --jobs=1 --forbid-only --timeout=30000 --global-timeout=5400000 --retries=3 --reporter=dot,json
94+
- run: npx folio test/ --workers=1 --forbid-only --timeout=30000 --global-timeout=5400000 --retries=3 --reporter=dot,json
9595
shell: bash
9696
env:
9797
BROWSER: ${{ matrix.browser }}
98-
PWRUNNER_JSON_REPORT: "test-results/report.json"
98+
FOLIO_JSON_OUTPUT_NAME: "test-results/report.json"
9999
- uses: actions/upload-artifact@v1
100100
if: ${{ always() }}
101101
with:
@@ -142,12 +142,12 @@ jobs:
142142
# XVFB-RUN merges both STDOUT and STDERR, whereas we need only STDERR
143143
# Wrap `npm run` in a subshell to redirect STDERR to file.
144144
# Enable core dumps in the subshell.
145-
- 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"
145+
- 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"
146146
if: ${{ always() }}
147147
env:
148148
BROWSER: ${{ matrix.browser }}
149149
HEADLESS: "false"
150-
PWRUNNER_JSON_REPORT: "test-results/report.json"
150+
FOLIO_JSON_OUTPUT_NAME: "test-results/report.json"
151151
- uses: actions/upload-artifact@v1
152152
if: ${{ always() }}
153153
with:
@@ -175,11 +175,11 @@ jobs:
175175
# XVFB-RUN merges both STDOUT and STDERR, whereas we need only STDERR
176176
# Wrap `npm run` in a subshell to redirect STDERR to file.
177177
# Enable core dumps in the subshell.
178-
- 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"
178+
- 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"
179179
env:
180180
BROWSER: ${{ matrix.browser }}
181181
PWWIRE: true
182-
PWRUNNER_JSON_REPORT: "test-results/report.json"
182+
FOLIO_JSON_OUTPUT_NAME: "test-results/report.json"
183183
- uses: actions/upload-artifact@v1
184184
if: ${{ always() }}
185185
with:
@@ -207,11 +207,11 @@ jobs:
207207
# XVFB-RUN merges both STDOUT and STDERR, whereas we need only STDERR
208208
# Wrap `npm run` in a subshell to redirect STDERR to file.
209209
# Enable core dumps in the subshell.
210-
- 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"
210+
- 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"
211211
env:
212212
BROWSER: ${{ matrix.browser }}
213213
TRACING: true
214-
PWRUNNER_JSON_REPORT: "test-results/report.json"
214+
FOLIO_JSON_OUTPUT_NAME: "test-results/report.json"
215215
- uses: actions/upload-artifact@v1
216216
if: ${{ always() }}
217217
with:

package-lock.json

Lines changed: 39 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
"node": ">=10.17.0"
1010
},
1111
"scripts": {
12-
"ctest": "cross-env BROWSER=chromium test-runner test/",
13-
"ftest": "cross-env BROWSER=firefox test-runner test/",
14-
"wtest": "cross-env BROWSER=webkit test-runner test/",
15-
"test": "test-runner test/",
12+
"ctest": "cross-env BROWSER=chromium folio test/",
13+
"ftest": "cross-env BROWSER=firefox folio test/",
14+
"wtest": "cross-env BROWSER=webkit folio test/",
15+
"test": "folio test/",
1616
"eslint": "[ \"$CI\" = true ] && eslint --quiet -f codeframe --ext js,ts . || eslint --ext js,ts .",
1717
"tsc": "tsc -p .",
1818
"tsc-installer": "tsc -p ./src/install/tsconfig.json",
1919
"doc": "node utils/doclint/cli.js",
20-
"test-infra": "test-runner utils/doclint/check_public_api/test/test.js && test-runner utils/doclint/preprocessor/test.js",
20+
"test-infra": "folio utils/doclint/check_public_api/test/test.js && folio utils/doclint/preprocessor/test.js",
2121
"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",
2222
"clean": "rimraf lib && rimraf types",
2323
"prepare": "node install-from-github.js",
@@ -50,7 +50,6 @@
5050
"ws": "^7.3.1"
5151
},
5252
"devDependencies": {
53-
"@playwright/test-runner": "0.9.22",
5453
"@types/debug": "^4.1.5",
5554
"@types/extract-zip": "^1.6.2",
5655
"@types/mime": "^2.0.3",
@@ -69,6 +68,7 @@
6968
"electron": "^9.2.1",
7069
"eslint": "^7.7.0",
7170
"eslint-plugin-notice": "^0.9.10",
71+
"folio": "=0.3.6",
7272
"formidable": "^1.2.2",
7373
"ncp": "^2.0.0",
7474
"node-stream-zip": "^1.11.3",

test/browsertype-connect.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
* limitations under the License.
1616
*/
1717

18-
import { serverFixtures } from './remoteServer.fixture';
18+
import { folio } from './remoteServer.fixture';
1919
import * as fs from 'fs';
20-
const { it, expect, describe } = serverFixtures;
20+
const { it, expect, describe } = folio;
2121

2222
describe('connect', (suite, { wire }) => {
2323
suite.skip(wire);

test/channels.spec.ts

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,20 @@
1616
*/
1717

1818
import domain from 'domain';
19-
import { fixtures as baseFixtures } from './fixtures';
19+
import { folio } from './fixtures';
2020
import type { ChromiumBrowser } from '..';
2121

22-
type DomainFixtures = {
23-
domain: any;
24-
};
25-
26-
const fixtures = baseFixtures.defineWorkerFixtures<DomainFixtures>({
27-
domain: async ({ }, test) => {
28-
const local = domain.create();
29-
local.run(() => { });
30-
let err;
31-
local.on('error', e => err = e);
32-
await test(null);
33-
if (err)
34-
throw err;
35-
}
22+
const fixtures = folio.extend<{ domain: any }, {}>();
23+
fixtures.domain.initWorker(async ({ }, run) => {
24+
const local = domain.create();
25+
local.run(() => { });
26+
let err;
27+
local.on('error', e => err = e);
28+
await run(null);
29+
if (err)
30+
throw err;
3631
});
37-
38-
const { it, expect } = fixtures;
32+
const { it, expect } = fixtures.build();
3933

4034
it('should work', async ({browser}) => {
4135
expect(!!browser['_connection']).toBeTruthy();

test/chromium/oopif.spec.ts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,18 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { fixtures as playwrightFixtures } from '../fixtures';
17+
import { folio } from '../fixtures';
1818

19-
const fixtures = playwrightFixtures.overrideWorkerFixtures({
20-
browser: async ({browserType, defaultBrowserOptions}, test) => {
21-
const browser = await browserType.launch({
22-
...defaultBrowserOptions,
23-
args: (defaultBrowserOptions.args || []).concat(['--site-per-process'])
24-
});
25-
await test(browser);
26-
await browser.close();
27-
}
19+
const fixtures = folio.extend();
20+
fixtures.browser.overrideWorker(async ({browserType, defaultBrowserOptions}, run) => {
21+
const browser = await browserType.launch({
22+
...defaultBrowserOptions,
23+
args: (defaultBrowserOptions.args || []).concat(['--site-per-process'])
24+
});
25+
await run(browser);
26+
await browser.close();
2827
});
29-
30-
const { it, expect, describe } = fixtures;
28+
const { it, expect, describe } = fixtures.build();
3129

3230
describe('oopif', (suite, { browserName }) => {
3331
suite.skip(browserName !== 'chromium');

test/chromium/tracing.spec.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,19 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { fixtures as playwrightFixtures } from '../fixtures';
17+
import { folio } from '../fixtures';
1818
import fs from 'fs';
1919
import path from 'path';
2020
import type { ChromiumBrowser } from '../..';
2121

2222
type TestState = {
2323
outputTraceFile: string;
2424
};
25-
const fixtures = playwrightFixtures.defineTestFixtures<TestState>({
26-
outputTraceFile: async ({ testInfo }, test) => {
27-
await test(testInfo.outputPath(path.join(`trace.json`)));
28-
}
25+
const fixtures = folio.extend<{}, TestState>();
26+
fixtures.outputTraceFile.initTest(async ({ testInfo }, run) => {
27+
await run(testInfo.outputPath(path.join(`trace.json`)));
2928
});
30-
31-
const { it, expect, describe } = fixtures;
29+
const { it, expect, describe } = fixtures.build();
3230

3331
describe('oopif', (suite, { browserName }) => {
3432
suite.skip(browserName !== 'chromium');

0 commit comments

Comments
 (0)