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

tools,test: apply markdown linting to test dir #22221

Closed
wants to merge 5 commits into from
Closed
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 Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,7 @@ else
@echo "Skipping Markdown linter on docs (no crypto)"
endif

LINT_MD_TARGETS = src lib benchmark tools/doc tools/icu
LINT_MD_TARGETS = src lib benchmark test tools/doc tools/icu
LINT_MD_ROOT_DOCS := $(wildcard *.md)
LINT_MD_MISC_FILES := $(shell find $(LINT_MD_TARGETS) -type f \
-not -path '*node_modules*' -name '*.md') $(LINT_MD_ROOT_DOCS)
Expand Down
44 changes: 22 additions & 22 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,25 @@ GitHub with the `autocrlf` git config flag set to true.

## Test Directories

|Directory |Runs on CI |Purpose |
|-------------------|---------------|---------------|
|abort |Yes |Tests for when the ``` --abort-on-uncaught-exception ``` flag is used.|
|addons |Yes |Tests for [addon](https://nodejs.org/api/addons.html) functionality along with some tests that require an addon to function properly.|
|addons-napi |Yes |Tests for [n-api](https://nodejs.org/api/n-api.html) functionality.|
|async-hooks |Yes |Tests for [async_hooks](https://nodejs.org/api/async_hooks.html) functionality.|
|cctest |Yes |C++ tests that are run as part of the build process.|
|code-cache |No |Tests for a Node.js binary compiled with V8 code cache.|
|common | |Common modules shared among many tests. [Documentation](./common/README.md)|
|doctool |Yes |Tests for the documentation generator.|
|es-module |Yes |Test ESM module loading.|
|fixtures | |Test fixtures used in various tests throughout the test suite.|
|internet |No |Tests that make real outbound connections (mainly networking related modules). Tests for networking related modules may also be present in other directories, but those tests do not make outbound connections.|
|known_issues |Yes |Tests reproducing known issues within the system. All tests inside of this directory are expected to fail consistently. If a test doesn't fail on certain platforms, those should be skipped via `known_issues.status`.|
|message |Yes |Tests for messages that are output for various conditions (```console.log```, error messages etc.)|
|parallel |Yes |Various tests that are able to be run in parallel.|
|pseudo-tty |Yes |Tests that require stdin/stdout/stderr to be a TTY.|
|pummel |No |Various tests for various modules / system functionality operating under load.|
|sequential |Yes |Various tests that are run sequentially.|
|testpy | |Test configuration utility used by various test suites.|
|tick-processor |No |Tests for the V8 tick processor integration. The tests are for the logic in ```lib/internal/v8_prof_processor.js``` and ```lib/internal/v8_prof_polyfill.js```. The tests confirm that the profile processor packages the correct set of scripts from V8 and introduces the correct platform specific logic.|
|v8-updates |No |Tests for V8 performance integration.|
| Directory | Runs on CI | Purpose |
| ------------------- | --------------- | --------------- |
| `abort` | Yes | Tests for when the ``` --abort-on-uncaught-exception ``` flag is used. |
Copy link
Member

Choose a reason for hiding this comment

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

Out of interest, are the added backticks for the Directory column because of the linter or a stylistic change?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's a clunky workaround for the linter flagging bare-text v8. If it sees v8 in backticks, it assumes it's part of code or a directory listing or something like that, but if it sees it bare, it flags it as a prohibited string and assumes you meant V8 instead.

I actually do think the directory names should be in backticks, but I also acknowledge that's a debatable position. :-D

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the explanation. I'm okay with the backticks, it just wasn't obvious to me why they were added.

| `addons` | Yes | Tests for [addon](https://nodejs.org/api/addons.html) functionality along with some tests that require an addon to function properly. |
| `addons-napi` | Yes | Tests for [n-api](https://nodejs.org/api/n-api.html) functionality. |
| `async-hooks` | Yes | Tests for [async_hooks](https://nodejs.org/api/async_hooks.html) functionality. |
| `cctest` | Yes | C++ tests that are run as part of the build process. |
| `code-cache` | No | Tests for a Node.js binary compiled with V8 code cache. |
| `common` | | Common modules shared among many tests. [Documentation](./common/README.md) |
| `doctool` | Yes | Tests for the documentation generator. |
| `es-module` | Yes | Test ESM module loading. |
| `fixtures` | | Test fixtures used in various tests throughout the test suite. |
| `internet` | No | Tests that make real outbound connections (mainly networking related modules). Tests for networking related modules may also be present in other directories, but those tests do not make outbound connections. |
| `known_issues` | Yes | Tests reproducing known issues within the system. All tests inside of this directory are expected to fail consistently. If a test doesn't fail on certain platforms, those should be skipped via `known_issues.status`. |
| `message` | Yes | Tests for messages that are output for various conditions (```console.log```, error messages etc.) |
| `parallel` | Yes | Various tests that are able to be run in parallel. |
| `pseudo-tty` | Yes | Tests that require stdin/stdout/stderr to be a TTY. |
| `pummel` | No | Various tests for various modules / system functionality operating under load. |
| `sequential` | Yes | Various tests that are run sequentially. |
| `testpy` | | Test configuration utility used by various test suites. |
| `tick-processor` | No | Tests for the V8 tick processor integration. The tests are for the logic in ```lib/internal/v8_prof_processor.js``` and ```lib/internal/v8_prof_polyfill.js```. The tests confirm that the profile processor packages the correct set of scripts from V8 and introduces the correct platform specific logic. |
| `v8-updates` | No | Tests for V8 performance integration. |
2 changes: 1 addition & 1 deletion test/async-hooks/coverage.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## AsyncHooks Coverage Overview
# AsyncHooks Coverage Overview

Showing which kind of async resource is covered by which test:

Expand Down
18 changes: 9 additions & 9 deletions test/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ one listed below. (`heap.validateSnapshotNodes(...)` is a shortcut for

Create a heap dump and an embedder graph copy and validate occurrences.

<!-- eslint-disable no-undef, no-unused-vars, node-core/required-modules, strict -->
<!-- eslint-disable no-undef, node-core/required-modules -->
```js
validateSnapshotNodes('TLSWRAP', [
{
Expand All @@ -590,7 +590,7 @@ validateSnapshotNodes('TLSWRAP', [
The http2.js module provides a handful of utilities for creating mock HTTP/2
frames for testing of HTTP/2 endpoints

<!-- eslint-disable no-undef, no-unused-vars, node-core/required-modules, strict -->
<!-- eslint-disable no-unused-vars, node-core/required-modules -->
```js
const http2 = require('../common/http2');
```
Expand All @@ -600,7 +600,7 @@ const http2 = require('../common/http2');
The `http2.Frame` is a base class that creates a `Buffer` containing a
serialized HTTP/2 frame header.

<!-- eslint-disable no-undef, no-unused-vars, node-core/required-modules, strict -->
<!-- eslint-disable no-undef, node-core/required-modules -->
```js
// length is a 24-bit unsigned integer
// type is an 8-bit unsigned integer identifying the frame type
Expand All @@ -619,7 +619,7 @@ The serialized `Buffer` may be retrieved using the `frame.data` property.
The `http2.DataFrame` is a subclass of `http2.Frame` that serializes a `DATA`
frame.

<!-- eslint-disable no-undef, no-unused-vars, node-core/required-modules, strict -->
<!-- eslint-disable no-undef, node-core/required-modules -->
```js
// id is the 32-bit stream identifier
// payload is a Buffer containing the DATA payload
Expand All @@ -636,7 +636,7 @@ socket.write(frame.data);
The `http2.HeadersFrame` is a subclass of `http2.Frame` that serializes a
`HEADERS` frame.

<!-- eslint-disable no-undef, no-unused-vars, node-core/required-modules, strict -->
<!-- eslint-disable no-undef, node-core/required-modules -->
```js
// id is the 32-bit stream identifier
// payload is a Buffer containing the HEADERS payload (see either
Expand All @@ -654,7 +654,7 @@ socket.write(frame.data);
The `http2.SettingsFrame` is a subclass of `http2.Frame` that serializes an
empty `SETTINGS` frame.

<!-- eslint-disable no-undef, no-unused-vars, node-core/required-modules, strict -->
<!-- eslint-disable no-undef, node-core/required-modules -->
```js
// ack is a boolean indicating whether or not to set the ACK flag.
const frame = new http2.SettingsFrame(ack);
Expand All @@ -667,7 +667,7 @@ socket.write(frame.data);
Set to a `Buffer` instance that contains a minimal set of serialized HTTP/2
request headers to be used as the payload of a `http2.HeadersFrame`.

<!-- eslint-disable no-undef, no-unused-vars, node-core/required-modules, strict -->
<!-- eslint-disable no-undef, node-core/required-modules -->
```js
const frame = new http2.HeadersFrame(1, http2.kFakeRequestHeaders, 0, true);

Expand All @@ -679,7 +679,7 @@ socket.write(frame.data);
Set to a `Buffer` instance that contains a minimal set of serialized HTTP/2
response headers to be used as the payload a `http2.HeadersFrame`.

<!-- eslint-disable no-undef, no-unused-vars, node-core/required-modules, strict -->
<!-- eslint-disable no-undef, node-core/required-modules -->
```js
const frame = new http2.HeadersFrame(1, http2.kFakeResponseHeaders, 0, true);

Expand All @@ -691,7 +691,7 @@ socket.write(frame.data);
Set to a `Buffer` containing the preamble bytes an HTTP/2 client must send
upon initial establishment of a connection.

<!-- eslint-disable no-undef, no-unused-vars, node-core/required-modules, strict -->
<!-- eslint-disable no-undef, node-core/required-modules -->
```js
socket.write(http2.kClientMagic);
```
Expand Down
2 changes: 2 additions & 0 deletions test/fixtures/0-dns/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# 0-dns

## Purpose
The test cert file for use `test/parallel/test-tls-0-dns-altname.js`
can be created by using `asn1.js` and `asn1.js-rfc5280`,
Expand Down