| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Sorry, something went wrong.
|
This is a draft/wip because it currently (legitimately) fails: -bash-4.2$ ./node test/parallel/test-process-env-allowed-flags-are-documented.js
assert.js:89
throw new AssertionError(obj);
^
AssertionError [ERR_ASSERTION]: The following options are not documented as allowed in NODE_OPTIONS in /home/users/riclau/sandbox/github/nodejs/doc/api/cli.md: --tls-min-v1.2 --input-type --experimental-worker --tls-min-v1.3 --debug-arraybuffer-allocations --tls-max-v1.2 --experimental-policy --preserve-symlinks --http-parser --tls-min-v1.0 --es-module-specifier-resolution --preserve-symlinks-main --tls-max-v1.3 --tls-min-v1.1 --prof-process -r --debug-port
at Object.<anonymous> (/home/users/riclau/sandbox/github/nodejs/test/parallel/test-process-env-allowed-flags-are-documented.js:35:8)
at Module._compile (internal/modules/cjs/loader.js:777:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:788:10)
at Module.load (internal/modules/cjs/loader.js:640:32)
at Function.Module._load (internal/modules/cjs/loader.js:555:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:840:10)
at internal/main/run_main_module.js:17:11 {
generatedMessage: false,
code: 'ERR_ASSERTION',
actual: 17,
expected: 0,
operator: 'strictEqual'
}
-bash-4.2$#28146 will fix the missing tls options. I'll add the other missing entries to the docs. If anyone sees anything in this list that shouldn't be there please say so. |
Sorry, something went wrong.
There was a problem hiding this comment.
This seems brittle. A line-wrap change could break it. And I'll definitely break it when I inevitably decide to reduce passive voice from the doc. But I don't have a better idea, so...¯\(ツ)/¯ (FWIW, I'd prefer if the doc said something like "Valid options are:". But obviously that can and likely should be some other PR some time.)
Sorry, something went wrong.
There was a problem hiding this comment.
FWIW if we change the line in doc/api/cli.md to Valid options are: the test fails:
-bash-4.2$ ./node test/parallel/test-process-env-allowed-flags-are-documented.js
/home/users/riclau/sandbox/github/nodejs/test/parallel/test-process-env-allowed-flags-are-documented.js:17
const docOptions = cliDocs.match(docRegExp)[0];
^
TypeError: Cannot read property '0' of null
at Object.<anonymous> (/home/users/riclau/sandbox/github/nodejs/test/parallel/test-process-env-allowed-flags-are-documented.js:17:44)
at Module._compile (internal/modules/cjs/loader.js:779:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:790:10)
at Module.load (internal/modules/cjs/loader.js:642:32)
at Function.Module._load (internal/modules/cjs/loader.js:555:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:842:10)
at internal/main/run_main_module.js:17:11
-bash-4.2$I'll see what we can do to make this better.
Sorry, something went wrong.
There was a problem hiding this comment.
@Trott Changed this so that it now starts at the section header, which is less likely to change. PTAL.
(Test now still works when the prose is changed to "Valid options are:" but I'll let you make that change.)
Sorry, something went wrong.
There was a problem hiding this comment.
Since HTML comments are valid Markdown, maybe we can delineate the list with a self-documenting HTML comment and use a RegExp to search for that? A suggestion, but totally not blocking this.
Sorry, something went wrong.
There was a problem hiding this comment.
Added HTML comment markers. PTAL.
Of course now we have markers the follow on step would be to automatically update the list (since Node.js know which options are allowed in the environment and we've marked in the document where the lists should go). I'd prefer that to be a follow on PR 😁.
Sorry, something went wrong.
|
One more thought: we might also validate the correct documentation order. |
Sorry, something went wrong.
Add missing options to the list of allowed options for the `NODE_OPTIONS` environment variable. Sort the list alphabetically.
Add a test that checks that the documented allowed options for the `NODE_OPTIONS` environment variable are consistent with the actually allowed options.
@BridgeAR After changing the test and documentation to use markers to denote where to parse the options from the documentation this ended up being much easier so I've updated the test to check the options are alphabetically sorted. |
Sorry, something went wrong.
Sorry, something went wrong.
|
A lint rule might be better? |
Sorry, something went wrong.
The node binary running the linter may not be the same as the one corresponding to the source tree. However I won't stand in the way if anyone else wants to attempt this as a lint rule. |
Sorry, something went wrong.
Add missing options to the list of allowed options for the `NODE_OPTIONS` environment variable. Sort the list alphabetically. PR-URL: nodejs#28179 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Add a test that checks that the documented allowed options for the `NODE_OPTIONS` environment variable are consistent with the actually allowed options. PR-URL: nodejs#28179 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Add missing options to the list of allowed options for the `NODE_OPTIONS` environment variable. Sort the list alphabetically. PR-URL: #28179 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Add a test that checks that the documented allowed options for the `NODE_OPTIONS` environment variable are consistent with the actually allowed options. PR-URL: #28179 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Add missing options to the list of allowed options for the `NODE_OPTIONS` environment variable. Sort the list alphabetically. PR-URL: #28179 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Add a test that checks that the documented allowed options for the `NODE_OPTIONS` environment variable are consistent with the actually allowed options. PR-URL: #28179 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
| Back | FazBrowse Home | New Git URL |
doc: add missing options allowed in NODE_OPTIONS
Add missing options to the list of allowed options for the
NODE_OPTIONS environment variable. Sort the list alphabetically.
doc,test: test documentation consistency for NODE_OPTIONS
Add a test that checks that the documented allowed options for the
NODE_OPTIONS environment variable are consistent with the actually
allowed options.
Checklist