sumlyzer 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -45
- package/package.json +11 -17
package/README.md
CHANGED
|
@@ -11,9 +11,18 @@
|
|
|
11
11
|
<a href="./LICENSE"><img src="https://img.shields.io/npm/l/sumlyzer.svg" alt="license" /></a>
|
|
12
12
|
</p>
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
## Ever lost a failing test in thousands of lines of workspace output?
|
|
15
|
+
|
|
16
|
+
## Ever wished your npm workspaces stopped at the first failure?
|
|
17
|
+
|
|
18
|
+
`npm run test --workspaces --if-present` runs every workspace, but gives you no
|
|
19
|
+
aggregated summary and no way to fail fast — an early failure just scrolls off
|
|
20
|
+
screen once later workspaces print their own output.
|
|
21
|
+
|
|
22
|
+
Sumlyzer runs each workspace's test script, one by one or concurrently.
|
|
23
|
+
Passing workspaces collapse to a single line, failing ones print just the
|
|
24
|
+
relevant failure detail, and everything ends with an aggregated pass/fail
|
|
25
|
+
summary table so nothing scrolls out of the terminal.
|
|
17
26
|
|
|
18
27
|
## Requirements
|
|
19
28
|
|
|
@@ -68,6 +77,11 @@ The exit code is `1` even if every workspace's tests passed.
|
|
|
68
77
|
- Concurrent runs (`--concurrency <n>`): run several workspaces' test scripts
|
|
69
78
|
at once instead of one by one
|
|
70
79
|
|
|
80
|
+
## Roadmap
|
|
81
|
+
|
|
82
|
+
- **Watch mode**: walking the workspace dependency graph (topological sort) so a change in
|
|
83
|
+
one workspace also re-runs the workspaces that depend on it.
|
|
84
|
+
|
|
71
85
|
## Example
|
|
72
86
|
|
|
73
87
|
```
|
|
@@ -77,26 +91,10 @@ running scanner
|
|
|
77
91
|
✓ scanner 10.1s (161/162 tests)
|
|
78
92
|
running tarball
|
|
79
93
|
✓ tarball 1.8s (77/77 tests)
|
|
80
|
-
running mama
|
|
81
|
-
✓ mama 1.2s (85/85 tests)
|
|
82
94
|
running tree-walker
|
|
83
95
|
✓ tree-walker 3.0s (26/26 tests)
|
|
84
|
-
running conformance
|
|
85
|
-
✓ conformance 1.1s (35/35 tests)
|
|
86
|
-
running i18n
|
|
87
|
-
✓ i18n 1.1s (19/19 tests)
|
|
88
|
-
running rc
|
|
89
|
-
✓ rc 4.1s (28/28 tests)
|
|
90
|
-
running utils
|
|
91
|
-
✓ utils 1.1s (30/30 tests)
|
|
92
96
|
running flags
|
|
93
97
|
✓ flags 1.1s (9/9 tests)
|
|
94
|
-
running fs-walk
|
|
95
|
-
✓ fs-walk 1.1s (3/3 tests)
|
|
96
|
-
running github
|
|
97
|
-
✓ github 2.9s (8/8 tests)
|
|
98
|
-
running gitlab
|
|
99
|
-
✓ gitlab 4.3s (8/8 tests)
|
|
100
98
|
|
|
101
99
|
Summary
|
|
102
100
|
┌─────────────┬────────┬──────────┬───────────────┬───────┬───────┬──────┬──────┬──────┬───────────┐
|
|
@@ -105,37 +103,28 @@ Summary
|
|
|
105
103
|
│ contact │ 'PASS' │ '2.6s' │ '0.9s' │ '35' │ '35' │ '0' │ '0' │ '0' │ '0' │
|
|
106
104
|
│ scanner │ 'PASS' │ '10.1s' │ '8.7s' │ '162' │ '161' │ '0' │ '1' │ '0' │ '0' │
|
|
107
105
|
│ tarball │ 'PASS' │ '1.8s' │ '0.7s' │ '77' │ '77' │ '0' │ '0' │ '0' │ '0' │
|
|
108
|
-
│ mama │ 'PASS' │ '1.2s' │ '0.1s' │ '85' │ '85' │ '0' │ '0' │ '0' │ '0' │
|
|
109
106
|
│ tree-walker │ 'PASS' │ '3.0s' │ '2.0s' │ '26' │ '26' │ '0' │ '0' │ '0' │ '0' │
|
|
110
|
-
│ conformance │ 'PASS' │ '1.1s' │ '0.1s' │ '35' │ '35' │ '0' │ '0' │ '0' │ '0' │
|
|
111
|
-
│ i18n │ 'PASS' │ '1.1s' │ '0.2s' │ '19' │ '19' │ '0' │ '0' │ '0' │ '0' │
|
|
112
|
-
│ rc │ 'PASS' │ '4.1s' │ '0.6s' │ '28' │ '28' │ '0' │ '0' │ '0' │ '0' │
|
|
113
|
-
│ utils │ 'PASS' │ '1.1s' │ '0.1s' │ '30' │ '30' │ '0' │ '0' │ '0' │ '0' │
|
|
114
107
|
│ flags │ 'PASS' │ '1.1s' │ '0.1s' │ '9' │ '9' │ '0' │ '0' │ '0' │ '0' │
|
|
115
|
-
│ fs-walk │ 'PASS' │ '1.1s' │ '0.1s' │ '3' │ '3' │ '0' │ '0' │ '0' │ '0' │
|
|
116
|
-
│ github │ 'PASS' │ '2.9s' │ '2.0s' │ '8' │ '8' │ '0' │ '0' │ '0' │ '0' │
|
|
117
|
-
│ gitlab │ 'PASS' │ '4.3s' │ '3.3s' │ '8' │ '8' │ '0' │ '0' │ '0' │ '0' │
|
|
118
108
|
└─────────────┴────────┴──────────┴───────────────┴───────┴───────┴──────┴──────┴──────┴───────────┘
|
|
119
109
|
|
|
120
|
-
|
|
110
|
+
5/5 workspaces passed.
|
|
121
111
|
```
|
|
122
112
|
|
|
123
113
|
### Summary columns
|
|
124
114
|
|
|
125
115
|
| Column | Meaning |
|
|
126
116
|
| --------------- | ------------------------------------------------------------------------------------------------ |
|
|
127
|
-
| `(index)` | Workspace name
|
|
128
|
-
| `status` | `PASS`, `FAIL`, or `SKIPPED` (
|
|
117
|
+
| `(index)` | Workspace name |
|
|
118
|
+
| `status` | `PASS`, `FAIL`, or `SKIPPED` (reached when `--ff` stopped scheduling before this workspace ran) |
|
|
129
119
|
| `duration` | Wall-clock time for the whole `npm run <script> --workspace=<path>` process, including npm/spawn overhead |
|
|
130
|
-
| `testsDuration` | `duration_ms` as reported by node's own test runner
|
|
120
|
+
| `testsDuration` | `duration_ms` as reported by node's own test runner |
|
|
131
121
|
| `tests` | Total number of tests node:test ran in that workspace |
|
|
132
122
|
| `pass` | Number of passing tests |
|
|
133
123
|
| `fail` | Number of failing tests |
|
|
134
124
|
| `skip` | Tests reported as skipped (`ℹ skipped`), e.g. `t.skip()` or `{ skip: true }` |
|
|
135
|
-
| `todo` | Tests reported as todo (`ℹ todo`), e.g. `t.todo()`
|
|
136
|
-
| `cancelled` | Tests reported as cancelled (`ℹ cancelled`),
|
|
125
|
+
| `todo` | Tests reported as todo (`ℹ todo`), e.g. `t.todo()` |
|
|
126
|
+
| `cancelled` | Tests reported as cancelled (`ℹ cancelled`), unlike `skip`/`todo` this usually signals a real problem |
|
|
137
127
|
|
|
138
|
-
`duration` and `testsDuration` are deliberately both shown: a gap between them usually means npm/process startup overhead rather than slow tests. `tests` always equals `pass + fail + skip + todo + cancelled`; the last three columns exist so none of those buckets can hide silently behind an all-green `pass`/`fail` pair.
|
|
139
128
|
|
|
140
129
|
### On failure
|
|
141
130
|
|
|
@@ -236,17 +225,11 @@ workspace already running when the failure is detected runs to completion
|
|
|
236
225
|
|
|
237
226
|
## Why
|
|
238
227
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
This exact fail-fast behavior at the `--workspaces` level has been requested
|
|
245
|
-
from npm more than once:
|
|
246
|
-
[npm/rfcs#575](https://github.com/npm/rfcs/issues/575) (open) and
|
|
247
|
-
[npm/rfcs#602](https://github.com/npm/rfcs/issues/602) (closed). Until it
|
|
248
|
-
lands (if it ever does), sumlyzer's `--ff` flag gets you there — see also
|
|
249
|
-
this [Stack Overflow answer](https://stackoverflow.com/questions/71300870/npm-workspace-command-does-not-stop-executing-when-command-fails-for-a-workspace/79989284#79989284)
|
|
228
|
+
This fail-fast behavior at the `--workspaces` level has been requested from
|
|
229
|
+
npm more than once: [npm/rfcs#575](https://github.com/npm/rfcs/issues/575)
|
|
230
|
+
(open) and [npm/rfcs#602](https://github.com/npm/rfcs/issues/602) (closed).
|
|
231
|
+
Until it lands, sumlyzer's `--ff` flag gets you there — see also this
|
|
232
|
+
[Stack Overflow answer](https://stackoverflow.com/questions/71300870/npm-workspace-command-does-not-stop-executing-when-command-fails-for-a-workspace/79989284#79989284)
|
|
250
233
|
on the same problem.
|
|
251
234
|
|
|
252
235
|
## Contributing
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sumlyzer",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "Run every npm workspace's test script, only show output for the ones that fail, and finish with an aggregated pass/fail summary.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -24,25 +24,19 @@
|
|
|
24
24
|
"release": "npm publish --dry-run"
|
|
25
25
|
},
|
|
26
26
|
"keywords": [
|
|
27
|
-
"npm",
|
|
28
|
-
"
|
|
29
|
-
"test
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"test
|
|
27
|
+
"npm workspaces test output",
|
|
28
|
+
"npm workspaces logs",
|
|
29
|
+
"node test runner",
|
|
30
|
+
"node --test",
|
|
31
|
+
"monorepo test output",
|
|
32
|
+
"workspace test logs",
|
|
33
|
+
"parallel test output",
|
|
34
|
+
"npm test readability",
|
|
33
35
|
"cli",
|
|
34
|
-
"fail-fast",
|
|
35
|
-
"summary",
|
|
36
|
-
"npm-workspaces",
|
|
37
|
-
"monorepo",
|
|
38
|
-
"test-reporter",
|
|
39
|
-
"node-test",
|
|
40
|
-
"node:test",
|
|
41
|
-
"test-summary",
|
|
42
|
-
"ci",
|
|
43
36
|
"junit",
|
|
44
37
|
"junit-xml",
|
|
45
|
-
"github-actions"
|
|
38
|
+
"github-actions",
|
|
39
|
+
"monorepo"
|
|
46
40
|
],
|
|
47
41
|
"author": {
|
|
48
42
|
"name": "Erwan Raulo",
|