mapbox / mapbox/node-cpp-skel

Blue sky: separate coverage reports for unit test + benchmarks

未关闭
#62 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
C++
星标
74
派生
9
PR 合并指标
30 天内没有已合并 PR

描述

Context

We use https://codecov.io for online reports of code coverage. We consider code coverage a critical tool in ensuring robust code since it:

  • Allows you to quickly see what code is actually run in your tests (to help find either dead code or code needing tests)
  • Helps you be motivated to write tests
  • Coverage shows how many times code is executed, by line: this can be a really helpful indication of where performance bottlenecks might be.

Currently we have coverage reporting available, by file and by line, that reflects just one metric: what code was executed when running the unit tests. This is viewable at https://codecov.io/gh/mapbox/node-cpp-skel/tree/620a268920ca47ca3bc49dd96fd8839e80774411/src.

Opportunity

@GretaCB is working on benchmarking scripts in #61. While the current code coverage answers the question of "what code do I have unit tests for?" it could also be useful, after #61 lands, to answer the question of "what code do I have benchmarks for?".

If the answer were: "only for some of the performance critical code and not all the performance critical code" then we have a problem. One of the easiest mistakes to make in performance optimization is to spend time optimizing the wrong thing. Performance optimization is hard enough when you are focused on the right code. So we should use all the tools we have to try to avoid this issue.

Solution

Codecov has a feature called flags. This allows you to mark a specific coverage upload by name. We could use this to provide display of coverage isolated to our unit tests vs our benchmark scripts. See more at https://docs.codecov.io/docs/flags

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

结合现有的单元测试覆盖率报告和 Codecov 的 flags 文档,审查 issue #61 中描述的基准测试工作。为单元测试和基准测试脚本分别定义覆盖率上传,然后验证 Codecov 是否独立显示这两份报告。

由索引模型根据 Issue 内容生成。

评估

技术栈
cpp
领域
performance, testing
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。