New idea for remote CC
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- php
- Área
- testing-qa
Línea de trabajo
Comienza revisando el issue #85 y el flujo existente de cobertura remota de C3, incluido cómo los módulos de navegador Selenium, REST y Php identifican actualmente las solicitudes. Traza después la ruta del informe de PHP CodeCoverage y de la serialización, y define con los maintainers el comportamiento de la conexión, el streaming, la limpieza y las pruebas en paralelo antes de la implementación.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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?
- Lenguaje dominante
- PHP
- Estrellas
- 73
- Forks
- 46
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Codeception/c3
-
remote coverage result all 0 Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
Codeception/c3#76 · 1 comentario · 1 reacción ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
Codeception/c3#58 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
Codeception/c3#41 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
Codeception/c3#40 · 5 comentarios ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 45/100
Codeception/c3#37 · 3 comentarios · 4 reacciones ·
Todos los issues de Codeception/c3
Issues similares
-
[Chore] Keep one viget-block-generator skill and replicate it, instead of four tracked copies Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
hector-jewell/food-delivery-system-for-restaurant-using-php#1311 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Sylius/SyliusGridBundle#501 ·