Support collection of code coverage from multiple services

Aperta
#603 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
42/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
cypress, typescript
Ambito
testing-qa

Direzione di ricerca

La issue menziona la configurazione codeCoverage esistente, l’unica proprietà url e expectBackendCoverageOnly; inizia individuando l’attuale punto di ingresso della raccolta della coverage e la gestione della relativa configurazione. Il lavoro è completo quando supporta più servizi con remotePath/localPath opzionali, preservando il comportamento esistente di url e la ricerca predefinita della coverage.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
440
Fork
114
Merge medio
42m
PR unite (30g)
19

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cypress-io/code-coverage

Tutte le issue di cypress-io/code-coverage

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.