New idea for remote CC
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- php
- Lĩnh vực
- testing-qa
Hướng nghiên cứu
Bắt đầu bằng việc xem xét issue #85 và quy trình coverage từ xa C3 hiện có, bao gồm cách các module trình duyệt Selenium, REST và Php hiện nhận diện các request. Tiếp theo, lần theo đường đi của báo cáo PHP CodeCoverage và quá trình serialization, rồi thống nhất với các maintainer về hành vi của kết nối, streaming, cleanup và kiểm thử song song trước khi triển khai.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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:
- 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.
- 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.
- 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)
final class PHP
{
public function process(CodeCoverage $coverage, ?string $target = null): string
{
$coverage->clearCache();
$buffer = "<?php
return \unserialize(<<<'END_OF_COVERAGE_SERIALIZATION'" . PHP_EOL . serialize($coverage) . PHP_EOL . 'END_OF_COVERAGE_SERIALIZATION' . PHP_EOL . ');';
if ($target !== null) {
if (!strpos($target, '://') !== false) {
Filesystem::createDirectory(dirname($target));
}
if (@file_put_contents($target, $buffer) === false) {
throw new WriteOperationFailedException($target);
}
}
return $buffer;
}
}
- Capture it like normal
- Use the
SebastianBergmann\CodeCoverage\Report\PHPreport to process it to a string - Stream the result to the calling code
- The calling code splits it using the end marker.
- Each part is deserialized to an of
Coverage, which can be merged with the base coverage object via $baseCoverage->append($unserializedCoverage)`
Optionally we could do some automatic path detection which in most cases should actually be trivial.
Thoughts?
- Ngôn ngữ chính
- PHP
- Star
- 73
- Fork
- 46
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Codeception/c3
-
remote coverage result all 0 Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
Codeception/c3#76 · 1 bình luận · 1 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
Codeception/c3#58 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
Codeception/c3#41 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
Codeception/c3#40 · 5 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
Codeception/c3#37 · 3 bình luận · 4 reaction ·
Tất cả issue của Codeception/c3
Issue tương tự
-
Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Automattic/safe-publish#594 ·
-
HttpClient
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
symfony/symfony-docs#23092 ·
-
sync-en
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
sync-en
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
-
Перевод устарел
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100