Support collection of code coverage from multiple services

Abierto
#603 0 comentarios 1 reacción 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
42/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
cypress, typescript
Área
testing-qa

Línea de trabajo

El issue menciona la configuración codeCoverage existente, la única propiedad url y expectBackendCoverageOnly; empieza localizando el punto de entrada actual de la recopilación de coverage y el manejo de su configuración. Se considera terminado cuando se admitan varios servicios con remotePath/localPath opcionales, conservando el comportamiento existente de url y la búsqueda de coverage predeterminada.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Is your feature request related to a problem? Please describe.
It is currently possible to fetch code coverage report from the browser (the frontend code) as well as backend.
However, you can configure only 1 endpoint and if your application is composed of multiple services, we need to be able to extract code coverage from them as well.

Describe the solution you'd like
I want to configure cypress in such a way that it will collect code coverage from multiple endpoints, and remove expectBackendCoverageOnly which i think is redundant for example:

codeCoverage: {
      collectFrontendCoverage: true,
      services: [
        {
          url: `${
            process.env.cypress_baseUrl || 'http://localhost:9001'
          }/__coverage__`,
          remotePath: `/backend`,
          localPath: `${process.cwd()}/backend`,
        },
        {
          url: `http://localhost:9002/__coverage__`,
          remotePath: `/app`,
          localPath: `${process.cwd()}/service2`,
        },
      ],
    },

In order to provide backward compatability, still use the url property, and by default search for coverage from window.originUrl/__coverage__
remotePath and localPath are optional. We need this in case we are running our services on a remote machine / docker container and the paths are not synced with our local sources path.

Describe alternatives you've considered
You can basically create a service that doing the collection for you from all the other services, but its not a good approach.
Additionally, instead of remotePath and localPath you can create a middleware on your service that perform the mapping of the local source path, to what it should be in the docker host, but again it is not a good approach.

Lenguaje dominante
TypeScript
Estrellas
440
Forks
114
Merge medio
42 min
PR fusionados (30 d)
19

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de cypress-io/code-coverage

Todos los issues de cypress-io/code-coverage

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.