@luolingp/request-doctor 0.15.0 → 0.15.1
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/docs/01-/350/275/257/344/273/266/351/234/200/346/261/202/350/247/204/346/240/274/350/257/264/346/230/216.md +1 -1
- package/docs/02-/350/275/257/344/273/266/350/256/276/350/256/241/350/257/264/346/230/216.md +1 -1
- package/docs/03-/350/275/257/344/273/266/346/265/213/350/257/225/346/212/245/345/221/212.md +4 -3
- package/docs/04-/345/256/211/350/243/205/351/203/250/347/275/262/350/257/264/346/230/216.md +1 -1
- package/docs/05-/347/224/250/346/210/267/346/211/213/345/206/214.md +1 -1
- package/docs/06-/350/275/257/344/273/266/350/264/250/351/207/217/345/272/246/351/207/217/346/212/245/345/221/212.md +1 -1
- package/docs/quality-report.json +9 -9
- package/lib/diagnostics.js +3 -1
- package/lib/skip-log.js +27 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# 软件测试报告
|
|
2
2
|
|
|
3
3
|
**产品名称**:request-doctor(请求急救员)
|
|
4
|
-
**版本**:0.15.
|
|
4
|
+
**版本**:0.15.1
|
|
5
5
|
**编制依据**:GB/T 8567-2006《计算机软件文档编制规范》6.6;GB/T 8566-2007 验证与确认过程
|
|
6
6
|
|
|
7
7
|
---
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
| `test/client-half.test.mjs` | 11 | 客户端半:模块身份、注入声明、apply 注册、组件能渲染 |
|
|
63
63
|
| `test/diagnostics.test.mjs` | 3 | 快照可选写入:不配置不写盘、突发合并、坏路径不致命 |
|
|
64
64
|
| `test/restart-notice.test.mjs` | 3 |
|
|
65
|
+
| `test/skip-log.test.mjs` | 4 | 未修复失败按类别归并:同类别计数、按频次排序、留最后一条 |
|
|
65
66
|
| `test/give-up-advice.test.mjs` | 5 | 不重试的类别各有可照做的建议,未知类别不编造 |
|
|
66
67
|
| `test/allow-route.test.mjs` | 4 | 授权路由:路径声明、坏请求体 400、空 spec 200 失败、正常放行 |
|
|
67
68
|
| `test/install-remote.test.mjs` | 2 | 远程安装的前置拒绝:非注册表名、缺 profile,均不触网 |
|
|
@@ -71,7 +72,7 @@
|
|
|
71
72
|
| `test/panel-blocked.test.mjs` | 7 | 冲突判定:审计兼容却被拒装、清单形状解析、给 allow 动作 |
|
|
72
73
|
| `test/panel-briefs.test.mjs` | 6 | 界面摘要:按名索引、只送可见行、缺数据不抛、不污染诊断 |
|
|
73
74
|
| `test/verdict-report.test.mjs` | 29 | why 与 list:判定、理由、环境摘要、自动扫描、分组、缺口、按形态给建议 | 缺导出判为需要重启;其它失败不误判;多次累积不覆盖 |
|
|
74
|
-
| **合计** | **
|
|
75
|
+
| **合计** | **241** | **全部通过** |
|
|
75
76
|
|
|
76
77
|
执行结果:
|
|
77
78
|
|
|
@@ -225,7 +226,7 @@
|
|
|
225
226
|
|
|
226
227
|
### 7.2 分文件执行结果
|
|
227
228
|
|
|
228
|
-
|
|
229
|
+
39 个测试文件逐个单独执行,每个都有用例且全部通过,不存在因导入失败而静默跳过的文件。用例数分布:compat.test.mjs 17、plugin.test.mjs 15、compat-env.test.mjs 14、classify.test.mjs 13,其余按职能分散,合计 241。
|
|
229
230
|
## 8 覆盖率实测
|
|
230
231
|
|
|
231
232
|
用 Node 自带的 `--experimental-test-coverage` 跑一遍,作为「分支有没有被真的走一遍」的证据。这不替代对断言质量的判断,只说明哪些代码从未被执行。
|
package/docs/quality-report.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"standard": "GB/T 45717-2025 信息技术 软件测量 软件质量测量 自动化的源代码质量测度",
|
|
3
|
-
"generatedAt": "2026-10-29T16:
|
|
3
|
+
"generatedAt": "2026-10-29T16:51:53.560Z",
|
|
4
4
|
"scope": {
|
|
5
|
-
"files":
|
|
6
|
-
"totalLines":
|
|
7
|
-
"sourceLines":
|
|
8
|
-
"commentLines":
|
|
5
|
+
"files": 38,
|
|
6
|
+
"totalLines": 5472,
|
|
7
|
+
"sourceLines": 3946,
|
|
8
|
+
"commentLines": 1013
|
|
9
9
|
},
|
|
10
10
|
"measures": {
|
|
11
|
-
"commentDensity": 25.
|
|
12
|
-
"duplicationPercent":
|
|
13
|
-
"functionCount":
|
|
11
|
+
"commentDensity": 25.67,
|
|
12
|
+
"duplicationPercent": 4.98,
|
|
13
|
+
"functionCount": 421,
|
|
14
14
|
"maxComplexity": 10,
|
|
15
15
|
"maxFunctionLines": 57,
|
|
16
16
|
"maxFileLines": 500,
|
|
17
|
-
"averageComplexity": 3.
|
|
17
|
+
"averageComplexity": 3.81
|
|
18
18
|
},
|
|
19
19
|
"limits": {
|
|
20
20
|
"maxComplexity": 10,
|
package/lib/diagnostics.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// 管三件事:各项修复计数、最近若干条事件、可选的快照文件。单独拎出来是因为组合根要
|
|
4
4
|
// 关心的是"怎么修",不该顺带管状态怎么记。
|
|
5
5
|
import { writeFileSync } from 'node:fs';
|
|
6
|
+
import { createSkipLog } from './skip-log.js';
|
|
6
7
|
|
|
7
8
|
// 最近事件留多少条给 /doctor 看
|
|
8
9
|
const MAX_LOG = 30;
|
|
@@ -21,6 +22,7 @@ export function createDiagnostics(input) {
|
|
|
21
22
|
last: [],
|
|
22
23
|
};
|
|
23
24
|
const diagnostics = { versionScan: null };
|
|
25
|
+
const skipped = createSkipLog();
|
|
24
26
|
let pending;
|
|
25
27
|
|
|
26
28
|
const snapshot = () => ({
|
|
@@ -73,5 +75,5 @@ export function createDiagnostics(input) {
|
|
|
73
75
|
writeNow();
|
|
74
76
|
};
|
|
75
77
|
|
|
76
|
-
return { record, scheduleWrite, writeNow, flush, scanError, stats, diagnostics, snapshot };
|
|
78
|
+
return { record, scheduleWrite, writeNow, flush, scanError, stats, skipped: () => skipped.read(), diagnostics, snapshot };
|
|
77
79
|
}
|
package/lib/skip-log.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// 本次会话里没救回来的失败。
|
|
2
|
+
//
|
|
3
|
+
// 日志是流式的,翻起来费事。这里按类别归并,只留每类最后一条与出现次数,
|
|
4
|
+
// 让「刚才那次为什么没救回来」能一眼看到。
|
|
5
|
+
|
|
6
|
+
const MAX_KINDS = 12;
|
|
7
|
+
|
|
8
|
+
// 可读的汇总对象:add 记账,read 取回按次数排序的列表。
|
|
9
|
+
export function createSkipLog() {
|
|
10
|
+
const entries = new Map();
|
|
11
|
+
return {
|
|
12
|
+
add(detail) {
|
|
13
|
+
const kind = String(detail).split(':')[0].trim();
|
|
14
|
+
const previous = entries.get(kind);
|
|
15
|
+
entries.set(kind, {
|
|
16
|
+
kind,
|
|
17
|
+
note: String(detail),
|
|
18
|
+
count: (previous?.count ?? 0) + 1,
|
|
19
|
+
at: new Date().toISOString(),
|
|
20
|
+
});
|
|
21
|
+
while (entries.size > MAX_KINDS) entries.delete(entries.keys().next().value);
|
|
22
|
+
},
|
|
23
|
+
read() {
|
|
24
|
+
return [...entries.values()].sort((a, b) => b.count - a.count);
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|