Codeception / Codeception/c3

New idea for remote CC

未关闭
#93 5 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
PHP
星标
73
派生
46
PR 合并指标
30 天内没有已合并 PR

描述

After reviewing #85 (good work keep it going!) I thought of a different approach to code coverage that might work cleanly as well.

The idea:
1. Before a test starts, connect to C3, this is a "long lived" connection. C3 creates a file temp file with a fixed name and watches it for data, this data is streamed back to the coverage module.
2. During the test each request to the server is profiled and the serialized result (php-codecoverage library supports serialization) is atomically written to the local temp file.
3. After the test ends we disconnect the stream from 1 and this prompts the remote coverage file to be removed

This could simplify things:
- We no longer need to mark each request with a cookie, which needs to be set in the browser module (Selenium, REST, or Php)
- We no longer have edge cases where fetch requests might not send cookies for example
- We cannot support parallel tests since we won't be able to know to which test the coverage belongs

## Streaming coverage
We can stream coverage for each request like this using the PHP report class (copied below since its short)
```php
final class PHP
{
public function process(CodeCoverage $coverage, ?string $target = null): string
{
$coverage->clearCache();

$buffer = "append($unserializedCoverage)`

Optionally we could do some automatic path detection which in most cases should actually be trivial.

Thoughts?

贡献指南

这个仓库没有索引到贡献指南

调研方向

首先审查 issue #85 和现有的 C3 远程覆盖率流程,包括 Selenium、REST 和 Php 浏览器模块当前如何识别请求。然后跟踪 PHP CodeCoverage 报告和序列化路径,并在实现之前与维护者确定连接、流式传输、清理和并行测试的行为。

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

评估

技术栈
php
领域
testing-qa
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

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