| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8a5325d commit b711256
78 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,6 @@ | |||
| 1 | + [submodule "test/web-platform-tests/wpt"] | ||
| 2 | + path = test/web-platform-tests/wpt | ||
| 3 | + url = https://github.com/web-platform-tests/wpt.git | ||
| 4 | + [submodule "test/fixtures/cache-tests"] | ||
| 5 | + path = test/fixtures/cache-tests | ||
| 6 | + url = https://github.com/http-tests/cache-tests | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -94,34 +94,50 @@ Create a commit which includes all of the updated files in lib/llhttp. | |||
| 94 | 94 | ||
| 95 | 95 | `undici` runs a subset of the [`web-platform-tests`](https://github.com/web-platform-tests/wpt). | |
| 96 | 96 | ||
| 97 | - ### Requirements: | ||
| 98 | - - [Node core utils](https://github.com/nodejs/node-core-utils) setup with credentials. | ||
| 99 | - | ||
| 100 | - To update every test, run the following commands. Typically you would only need to update the tests in a specific directory. | ||
| 97 | + ### Steps: | ||
| 101 | 98 | ||
| 102 | 99 | ```bash | |
| 103 | - git node wpt resources | ||
| 104 | - git node wpt interfaces | ||
| 105 | - git node wpt common | ||
| 106 | - git node wpt fetch | ||
| 107 | - git node wpt xhr | ||
| 108 | - git node wpt websockets | ||
| 109 | - git node wpt mimesniff | ||
| 110 | - git node wpt storage | ||
| 111 | - git node wpt service-workers | ||
| 112 | - git node wpt eventsource | ||
| 100 | + git submodule update --init --recursive | ||
| 113 | 101 | ``` | |
| 114 | 102 | ||
| 115 | - #### Run the tests | ||
| 103 | + ### Run the tests | ||
| 116 | 104 | ||
| 117 | 105 | Run the tests to ensure that any new failures are marked as such. | |
| 118 | 106 | ||
| 119 | - You can mark tests as failing in their corresponding [status](./test/wpt/status) file. | ||
| 107 | + Before running the tests for the first time, you must setup the testing environment. | ||
| 108 | + ```bash | ||
| 109 | + cd test/web-platform-tests | ||
| 110 | + node wpt-runner.mjs setup | ||
| 111 | + ``` | ||
| 112 | + | ||
| 113 | + To run all tests: | ||
| 120 | 114 | ||
| 121 | 115 | ```bash | |
| 122 | 116 | npm run test:wpt | |
| 123 | 117 | ``` | |
| 124 | 118 | ||
| 119 | + To run a subset of tests: | ||
| 120 | + ```bash | ||
| 121 | + cd test/web-platform-tests | ||
| 122 | + node wpt-runner.mjs run [filter] [filterb] | ||
| 123 | + ``` | ||
| 124 | + | ||
| 125 | + To run a single file: | ||
| 126 | + ```bash | ||
| 127 | + cd test/web-platform-tests | ||
| 128 | + node wpt-runner.mjs run /path/to/test | ||
| 129 | + ``` | ||
| 130 | + | ||
| 131 | + ### Debugging | ||
| 132 | + | ||
| 133 | + Verbose logging can be enabled by setting the [`NODE_DEBUG`](https://nodejs.org/api/cli.html#node_debugmodule) flag: | ||
| 134 | + | ||
| 135 | + ```bash | ||
| 136 | + npx cross-env NODE_DEBUG=UNDICI_WPT node --run test:wpt | ||
| 137 | + ``` | ||
| 138 | + | ||
| 139 | + (`npx cross-env` can be omitted on Linux and Mac) | ||
| 140 | + | ||
| 125 | 141 | <a id="lint"></a> | |
| 126 | 142 | ### Lint | |
| 127 | 143 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,6 @@ | |||
| 1 | 1 | # undici | |
| 2 | 2 | ||
| 3 | - [](https://github.com/nodejs/undici/actions/workflows/nodejs.yml) [](https://github.com/neostandard/neostandard) [](https://badge.fury.io/js/undici) [](https://codecov.io/gh/nodejs/undici) | ||
| 3 | + [](https://github.com/nodejs/undici/actions/workflows/nodejs.yml) [](https://github.com/neostandard/neostandard) [](https://badge.fury.io/js/undici) [](https://codecov.io/gh/nodejs/undici) | ||
| 4 | 4 | ||
| 5 | 5 | An HTTP/1.1 client, written from scratch for Node.js. | |
| 6 | 6 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | 3 | const WASM_BUILDER_CONTAINER = 'ghcr.io/nodejs/wasm-builder@sha256:975f391d907e42a75b8c72eb77c782181e941608687d4d8694c3e9df415a0970' // v0.0.9 | |
| 4 | 4 | ||
| 5 | - const { execSync } = require('node:child_process') | ||
| 5 | + const { execSync, execFileSync } = require('node:child_process') | ||
| 6 | 6 | const { writeFileSync, readFileSync } = require('node:fs') | |
| 7 | 7 | const { join, resolve } = require('node:path') | |
| 8 | 8 | ||
@@ -69,10 +69,10 @@ if (process.argv[2] === '--docker') { | |||
| 69 | 69 | } | |
| 70 | 70 | ||
| 71 | 71 | const hasApk = (function () { | |
| 72 | - try { execSync('command -v apk'); return true } catch (error) { return false } | ||
| 72 | + try { execSync('command -v apk'); return true } catch { return false } | ||
| 73 | 73 | })() | |
| 74 | 74 | const hasOptimizer = (function () { | |
| 75 | - try { execSync(`${WASM_OPT} --version`); return true } catch (error) { return false } | ||
| 75 | + try { execSync(`${WASM_OPT} --version`); return true } catch { return false } | ||
| 76 | 76 | })() | |
| 77 | 77 | if (hasApk) { | |
| 78 | 78 | // Gather information about the tools used for the build | |
@@ -104,7 +104,19 @@ ${join(WASM_SRC, 'src')}/*.c \ | |||
| 104 | 104 | ${WASM_LDLIBS}`, { stdio: 'inherit' }) | |
| 105 | 105 | ||
| 106 | 106 | if (hasOptimizer) { | |
| 107 | - execSync(`${WASM_OPT} ${WASM_OPT_FLAGS} --enable-simd -o ${join(WASM_OUT, 'llhttp_simd.wasm')} ${join(WASM_OUT, 'llhttp_simd.wasm')}`, { stdio: 'inherit' }) | ||
| 107 | + // Split WASM_OPT_FLAGS into an array, if not empty | ||
| 108 | + const wasmOptFlagsArray = WASM_OPT_FLAGS ? WASM_OPT_FLAGS.split(/\s+/).filter(Boolean) : [] | ||
| 109 | + execFileSync( | ||
| 110 | + WASM_OPT, | ||
| 111 | + [ | ||
| 112 | + ...wasmOptFlagsArray, | ||
| 113 | + '--enable-simd', | ||
| 114 | + '-o', | ||
| 115 | + join(WASM_OUT, 'llhttp_simd.wasm'), | ||
| 116 | + join(WASM_OUT, 'llhttp_simd.wasm') | ||
| 117 | + ], | ||
| 118 | + { stdio: 'inherit' } | ||
| 119 | + ) | ||
| 108 | 120 | } | |
| 109 | 121 | writeWasmChunk('llhttp_simd.wasm', 'llhttp_simd-wasm.js') | |
| 110 | 122 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments