From eb65296d6429fbebc64e6a71999bbc9c1c2d7cff Mon Sep 17 00:00:00 2001 From: "irons.du" Date: Wed, 16 Sep 2026 22:07:44 +0800 Subject: [PATCH 1/2] docs(roadmap): mark what is done, and record verified defects in the stale parts Three entries were already finished and still listed as pending: - Fuzz Testing: three libFuzzer targets exist, with corpora and CI wiring. - Per-module test files: eight files now (cpu, full_flow, http_handlers, logger, async_executor, result_parsing, renderer_parsing, thread_stacks). - Parallel ctest: verified with `ctest -j6`. Worth recording why it needed work rather than just noting it passes -- the tests used to truncate each other's files because the profiler's intermediate artifacts had fixed names in a shared directory. They carry the pid now, so process isolation is enough and no RESOURCE_LOCK is needed. The counts in that section had drifted too: test_http_handlers.cpp has 28 cases, not 15, and the `output_type` it mentioned was renamed to `renderer`. The section now states the current totals (8 targets, 79 TEST cases) so it can be checked against reality instead of trusted. The Conan/vcpkg entry said "libs is wrong and requirements are missing openssl/zlib/gtest/absl". Checking it, the recipe has six defects and abseil is declared, so the old wording was both incomplete and partly wrong. Recorded from static reading, explicitly flagged as unverified because conan is not installed here: a missing `check_min_cppstd` import (NameError as soon as validate() runs), the nonexistent `profiler_lib`, copy paths that do not match where CMake installs, a duplicated backward-cpp requirement, a `REMOTE_PROFILER_ENABLE_SYMBOLIZE` macro that exists nowhere in the code, and placeholder metadata. Two further breakages turned up while checking the port: `portfile.cmake` has `SHA512 0`, and the placeholder homepage is in four places including the root vcpkg.json, which is the primary path. Verified: links resolve, both workflow files untouched, and every file the new entries reference exists. --- ROADMAP.md | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 16ba8cd..fe622da 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -147,12 +147,16 @@ ## 二、测试覆盖 -- **为 `http_handlers` 补单元测试** ✅ 已新增 `tests/test_http_handlers.cpp`(15 个用例,不依赖 Drogon):`HandlerResponse` 工厂方法、`output_type` 校验、`/api/status` 契约、profiler 生命周期与 heap 快照唯一性 -- **`dispatch()`** ✅ 已处理:声明存在于 `include/profiler/http_handlers.h` 但从未定义,已**从公共头文件移除**(不提供按路径自动分发,路由由使用者框架注册) -- **补充 Web 资源嵌入测试**:验证内嵌 HTML 页面可正常返回 +当前 8 个测试目标、79 个 `TEST` 用例,`ctest` 全部通过。 + +- **为 `http_handlers` 补单元测试** ✅ `tests/test_http_handlers.cpp`(**28 个用例**,不依赖 Drogon):`HandlerResponse` 工厂方法、`renderer` 解析与 `duration` 钳制、`/api/status` 契约、profiler 生命周期、heap 快照唯一性、宿主会话不被抢占、并发拒绝语义 +- **`dispatch()`** ✅ 已处理:声明存在但从未定义,已**从公共头文件移除**(不提供按路径自动分发,路由由使用者框架注册) +- **按模块拆分测试文件** ✅ 已拆为 8 个文件(cpu / full_flow / http_handlers / logger / async_executor / result_parsing / renderer_parsing / thread_stacks) +- **启用 `ctest` 并行执行** ✅ 已实测 `ctest -j6` 通过。原先并行会失败:中间产物(`pprof_cpu_temp.prof`、`cpu_collapsed.prof` 等)用**固定文件名**放在共享目录,两个测试进程会互相截断文件——现按 PID 命名,因此不需要 `RESOURCE_LOCK`,靠进程隔离即可 +- **引入 Fuzz Testing** ✅ 已新增 3 个 libFuzzer 目标(`fuzz_renderer_output` / `fuzz_result_parsing` / `fuzz_http_params`)+ 手工种子语料 + `ctest -L fuzz` 语料回归与短时 fuzz,并接入 CI(`-DREMOTE_PROFILER_BUILD_FUZZERS=ON`,需 clang) +- **补充 Web 资源嵌入测试**:验证内嵌 HTML 页面可正常返回(`WebResources::getIndexPage()` 目前**无任何测试**) - 其余 handler 的端到端覆盖(需要 `./pprof` 与 `./flamegraph.pl`,依赖 CWD 可写) -- 按模块拆分测试文件;引入 GTest 测试标签;启用 `ctest` 并行执行 -- 引入 **Fuzz Testing** 覆盖 profile 解析路径 +- 引入 GTest 测试标签(当前仅 fuzz 目标带 `LABELS "fuzz"`,单元测试未分类) --- @@ -160,10 +164,24 @@ - **创建 git tag**:仓库当前**没有任何 tag**,但 `CHANGELOG.md` 与用户文档中的 `v0.1.0` 均指向它;应在 v0.1.0 对应提交上打 tag - **自动化发布流程**:GitHub Releases + 打包(tar.gz / 各发行版包) -- **重新评估 Conan / vcpkg 分发**: - - `conanfile.py` 使用的是 Conan 2 API,但 `self.cpp_info.libs` 仍写着已不存在的 `profiler_lib`,且 requirements 缺少 openssl/zlib/gtest/absl - - `ports/cpp-remote-profiler/` 未在 `vcpkg-configuration.json` 中注册(无 `overlay-ports`),实际无法通过 vcpkg 安装 - - 两条路径都未被文档正式支持,建议要么修好并在 README 中说明,要么删除 +- **重新评估 Conan / vcpkg 分发**(两条路径目前都不可用,且**文档未提及**) + - `conanfile.py` 静态检查出 6 处问题,**本机无 conan 故未实测**: + - `validate()` 调用 `check_min_cppstd()` 但**没有 import** → 一执行就 `NameError` + - `self.cpp_info.libs = ["profiler_lib"]` —— 该库名**不存在**,实际是 `profiler_core` 与 + `profiler_web`(见 `CMakeLists.txt` 的 `add_library`) + - `package()` 从 `build/lib` 拷贝产物,但 CMake 装到 `build//`,且本平台 + `CMAKE_INSTALL_LIBDIR=lib64` → 拷不到文件 + - `requirements()` **重复声明** `backward-cpp/1.6`;缺 `openssl`/`zlib`/`protobuf`/`gtest` + (drogon 会传递前三个,`gtest` 仅在构建测试时需要,而 `generate()` 已关掉测试, + 所以缺的实际只有隐式依赖,但显式声明更稳) + - `REMOTE_PROFILER_ENABLE_SYMBOLIZE` 宏**在代码中不存在**(只有 + `REMOTE_PROFILER_ENABLE_WEB`) + - `author` / `url` / `homepage` 仍是 `Your Name` / `your-org` 占位符 + - `ports/cpp-remote-profiler/` 存在(`portfile.cmake` + `vcpkg.json`),但 + `vcpkg-configuration.json` **只有 `overlay-triplets`、没有 `overlay-ports`**, + 因此 vcpkg 找不到它 + - 结论:**要么修好并在 README 中说明用法(需先装 conan/vcpkg 实测),要么删除**。 + 当前状态是"存在但不可用",比缺失更容易误导。 - 生成 **SBOM**(SPDX / CycloneDX) - 考虑 **CPM.cmake** 支持 From c810e5c773671f964de47fc6ff2fcf33889e18df Mon Sep 17 00:00:00 2001 From: "irons.du" Date: Wed, 16 Sep 2026 22:08:29 +0800 Subject: [PATCH 2/2] docs(roadmap): add the port checksum and placeholder findings, fix nesting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two findings from the previous entry's own verification did not make it into that commit -- the edit script asserted on an ASCII quote where the file uses the full-width one, so it wrote nothing and I reported it as written. They are here now, plus the indentation corrected: the entry had landed a level too deep, reading as a sub-item of "自动化发布流程". What the additions record: - `ports/cpp-remote-profiler/portfile.cmake` carries `SHA512 0`, a placeholder checksum. vcpkg verifies it after downloading, so the port fails to install even once registered in vcpkg-configuration.json. That is a second, independent reason the port cannot be used, beyond it not being registered. - The placeholder `your-org` homepage is in four places, and one of them is the root `vcpkg.json` -- the manifest on the primary, documented install path. The earlier entry only mentioned conanfile.py. Verified: every list indent is even, and each file the section references exists. --- ROADMAP.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index fe622da..f3342f5 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -172,14 +172,16 @@ - `package()` 从 `build/lib` 拷贝产物,但 CMake 装到 `build//`,且本平台 `CMAKE_INSTALL_LIBDIR=lib64` → 拷不到文件 - `requirements()` **重复声明** `backward-cpp/1.6`;缺 `openssl`/`zlib`/`protobuf`/`gtest` - (drogon 会传递前三个,`gtest` 仅在构建测试时需要,而 `generate()` 已关掉测试, - 所以缺的实际只有隐式依赖,但显式声明更稳) - - `REMOTE_PROFILER_ENABLE_SYMBOLIZE` 宏**在代码中不存在**(只有 - `REMOTE_PROFILER_ENABLE_WEB`) + (drogon 会传递前三个,`gtest` 仅在构建测试时需要而 `generate()` 已关掉测试) + - `REMOTE_PROFILER_ENABLE_SYMBOLIZE` 宏**在代码中不存在**(只有 `REMOTE_PROFILER_ENABLE_WEB`) - `author` / `url` / `homepage` 仍是 `Your Name` / `your-org` 占位符 - `ports/cpp-remote-profiler/` 存在(`portfile.cmake` + `vcpkg.json`),但 - `vcpkg-configuration.json` **只有 `overlay-triplets`、没有 `overlay-ports`**, - 因此 vcpkg 找不到它 + `vcpkg-configuration.json` **只有 `overlay-triplets`、没有 `overlay-ports`**,因此 vcpkg 找不到它 + - `ports/cpp-remote-profiler/portfile.cmake` 的 `SHA512 0` 是**占位校验和**, + vcpkg 下载后会校验失败 → 该端口即使注册了也无法安装 + - **占位符 URL 散落 4 处**,最要紧的是 `vcpkg.json`(主路径清单):`conanfile.py` 的 + author/url/homepage、`ports/cpp-remote-profiler/vcpkg.json` 的 homepage、**`vcpkg.json` + 的 homepage** —— 均为 `your-org` / `Your Name` - 结论:**要么修好并在 README 中说明用法(需先装 conan/vcpkg 实测),要么删除**。 当前状态是"存在但不可用",比缺失更容易误导。 - 生成 **SBOM**(SPDX / CycloneDX)