dsh-request-doctor 0.16.0 → 0.16.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/index.js +4 -2
- package/lib/status-path.js +16 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# 软件测试报告
|
|
2
2
|
|
|
3
3
|
**产品名称**:request-doctor(请求急救员)
|
|
4
|
-
**版本**:0.16.
|
|
4
|
+
**版本**:0.16.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/status-path.test.mjs` | 6 | 诊断落盘路径:默认兜底、空串表示不写、非字符串当未设 |
|
|
65
66
|
| `test/skip-path.test.mjs` | 2 | 端到端:真实 TLS 失败走到记账,同类累加 |
|
|
66
67
|
| `test/skipped-summary.test.mjs` | 3 | 诊断收拢 skip 记录:按类归并、其它类别不入账 |
|
|
67
68
|
| `test/skip-log.test.mjs` | 4 | 未修复失败按类别归并:同类别计数、按频次排序、留最后一条 |
|
|
@@ -74,7 +75,7 @@
|
|
|
74
75
|
| `test/panel-blocked.test.mjs` | 7 | 冲突判定:审计兼容却被拒装、清单形状解析、给 allow 动作 |
|
|
75
76
|
| `test/panel-briefs.test.mjs` | 6 | 界面摘要:按名索引、只送可见行、缺数据不抛、不污染诊断 |
|
|
76
77
|
| `test/verdict-report.test.mjs` | 29 | why 与 list:判定、理由、环境摘要、自动扫描、分组、缺口、按形态给建议 | 缺导出判为需要重启;其它失败不误判;多次累积不覆盖 |
|
|
77
|
-
| **合计** | **
|
|
78
|
+
| **合计** | **252** | **全部通过** |
|
|
78
79
|
|
|
79
80
|
执行结果:
|
|
80
81
|
|
|
@@ -228,7 +229,7 @@
|
|
|
228
229
|
|
|
229
230
|
### 7.2 分文件执行结果
|
|
230
231
|
|
|
231
|
-
|
|
232
|
+
42 个测试文件逐个单独执行,每个都有用例且全部通过,不存在因导入失败而静默跳过的文件。用例数分布:compat.test.mjs 17、plugin.test.mjs 15、compat-env.test.mjs 14、classify.test.mjs 13,其余按职能分散,合计 252。
|
|
232
233
|
## 8 覆盖率实测
|
|
233
234
|
|
|
234
235
|
用 Node 自带的 `--experimental-test-coverage` 跑一遍,作为「分支有没有被真的走一遍」的证据。这不替代对断言质量的判断,只说明哪些代码从未被执行。
|
package/docs/quality-report.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"standard": "GB/T 45717-2025 信息技术 软件测量 软件质量测量 自动化的源代码质量测度",
|
|
3
|
-
"generatedAt": "2026-10-29T17:
|
|
3
|
+
"generatedAt": "2026-10-29T17:08:43.683Z",
|
|
4
4
|
"scope": {
|
|
5
|
-
"files":
|
|
6
|
-
"totalLines":
|
|
7
|
-
"sourceLines":
|
|
8
|
-
"commentLines":
|
|
5
|
+
"files": 40,
|
|
6
|
+
"totalLines": 5511,
|
|
7
|
+
"sourceLines": 3966,
|
|
8
|
+
"commentLines": 1027
|
|
9
9
|
},
|
|
10
10
|
"measures": {
|
|
11
|
-
"commentDensity": 25.
|
|
12
|
-
"duplicationPercent": 4.
|
|
13
|
-
"functionCount":
|
|
11
|
+
"commentDensity": 25.9,
|
|
12
|
+
"duplicationPercent": 4.95,
|
|
13
|
+
"functionCount": 423,
|
|
14
14
|
"maxComplexity": 10,
|
|
15
|
-
"maxFunctionLines":
|
|
15
|
+
"maxFunctionLines": 58,
|
|
16
16
|
"maxFileLines": 500,
|
|
17
17
|
"averageComplexity": 3.82
|
|
18
18
|
},
|
package/index.js
CHANGED
|
@@ -26,6 +26,7 @@ import { installWithExemption } from './lib/install-rescue.js';
|
|
|
26
26
|
import { createDiagnostics } from './lib/diagnostics.js';
|
|
27
27
|
import { createRetryLedger } from './lib/retry-ledger.js';
|
|
28
28
|
import { createRuntimeProbe } from './lib/runtime-probe.js';
|
|
29
|
+
import { resolveStatusFile } from './lib/status-path.js';
|
|
29
30
|
import { createVersionRepair } from './lib/version-repair.js';
|
|
30
31
|
import { createRepairListeners } from './lib/repair-listeners.js';
|
|
31
32
|
import { registerDoctorCommand, registerPanelRoutes } from './lib/commands.js';
|
|
@@ -63,14 +64,15 @@ export function apply(ctx, rawConfig) {
|
|
|
63
64
|
const warn = (message) => ctx.logger.warn(message);
|
|
64
65
|
const policy = () => config;
|
|
65
66
|
|
|
67
|
+
const probe = createRuntimeProbe({ ctx, collectFacts: collectPackageFacts });
|
|
68
|
+
|
|
66
69
|
const diagnostics = createDiagnostics({
|
|
67
|
-
statusFile:
|
|
70
|
+
statusFile: resolveStatusFile(rawConfig?.statusFile, probe.runtimeFacts().profileDir),
|
|
68
71
|
log: (level, message) => ctx.logger[level]?.(message),
|
|
69
72
|
describe: () => ({ ...config, retryableToolPattern: String(config.retryableToolPattern) }),
|
|
70
73
|
trackTimer: (timer) => timers.add(timer),
|
|
71
74
|
});
|
|
72
75
|
|
|
73
|
-
const probe = createRuntimeProbe({ ctx, collectFacts: collectPackageFacts });
|
|
74
76
|
const ledger = createRetryLedger({ config: policy, warn });
|
|
75
77
|
const versionRepair = createVersionRepair({
|
|
76
78
|
config: policy,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// 诊断快照写到哪。
|
|
2
|
+
//
|
|
3
|
+
// 默认放在 profile 根目录:跟着 profile 走,卸载或迁移时不会散落在别处。
|
|
4
|
+
// 用户显式传空串表示「不要写盘」,这时必须尊重,不能兜回默认值。
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
|
|
7
|
+
export const STATUS_FILE_NAME = '.request-doctor-status.json';
|
|
8
|
+
|
|
9
|
+
// @param {string|undefined} configured - 配置里的 statusFile。
|
|
10
|
+
// @param {string|undefined} profileDir - profile 根目录,可能拿不到。
|
|
11
|
+
// @returns {string} 要写的路径;空串表示不写。
|
|
12
|
+
export function resolveStatusFile(configured, profileDir) {
|
|
13
|
+
if (typeof configured === 'string') return configured;
|
|
14
|
+
if (typeof profileDir !== 'string' || profileDir === '') return '';
|
|
15
|
+
return join(profileDir, STATUS_FILE_NAME);
|
|
16
|
+
}
|