Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance/#61 add rspec coverage #62

Merged
merged 7 commits into from
Jul 27, 2024
Merged

Conversation

kuri0616
Copy link
Collaborator

@kuri0616 kuri0616 commented Jul 9, 2024

対応するissue

対応内容

  • coverage分析を行うgem「SimpleCov」をインストール
  • rails-helperにsimplecovを読み込む設定を追加
  • 正確なcoverage分析を行うため現在使用していない「channels」「 jobs」「mailers」のファイルを分析対象外に設定
  • 不要なファイルのtest controllerを削除 routesの定義も削除
  • coverageファイルをgit対象外に設定

@kuri0616 kuri0616 added the enhancement New feature or request label Jul 9, 2024
@kuri0616 kuri0616 self-assigned this Jul 9, 2024
@kuri0616 kuri0616 added this to the 開発環境整備 milestone Jul 10, 2024
Copy link
Contributor

@kakeru-one kakeru-one left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rikuya98
コメントしました!

@@ -1,4 +1,10 @@
# This file is copied to spec/ when you run 'rails generate rspec:install'
require 'simplecov'
SimpleCov.start 'rails' do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

以下の設定も足しましょうか。
ブランチカバレッジの計測と、最低カバレッジの設定もしておきたいです。

enable_coverage :branch
minimum_coverage line: 75, branch: 75

動作確認

スクリーンショット 2024-07-21 23 02 46

そんなにHTMLを出力して閲覧することはないかなと思ったため
Copy link
Contributor

@kakeru-one kakeru-one left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ちょっと個人的に加えておきたい変更があったので、加えました。

455faba

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

カバレッジをテスト実行後に標準出力できるようにしました。

スクリーンショット 2024-07-21 23 19 45

Copy link
Contributor

@kakeru-one kakeru-one left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rikuya98
LGTM!

@kakeru-one kakeru-one merged commit 98de7dd into main Jul 27, 2024
1 check passed
@kuri0616 kuri0616 deleted the enhance/#61-add-rspec-coverage branch July 27, 2024 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
2 participants