Support collection of code coverage from multiple services

オープン
#603 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
42/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
cypress, typescript
領域
testing-qa

調査の方向性

この issue では、既存の codeCoverage 設定、単一の url プロパティ、expectBackendCoverageOnly が示されている。まず、現在の coverage 収集のエントリーポイントと、その設定処理を見つけることから始める。複数のサービスをオプションの remotePath/localPath とともにサポートし、既存の url の動作とデフォルトの coverage 検索を維持できれば完了とする。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
440
フォーク
114
平均マージ
42分
マージ済み PR(30日)
19

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

cypress-io/code-coverage のほかの issue

cypress-io/code-coverage の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。