Skip to content

Commit

Permalink
SimpleCov Coverage Report
Browse files Browse the repository at this point in the history
  • Loading branch information
harrrykp committed May 2, 2024
1 parent 75cdddc commit 5a333c0
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ DB_PORT=5432
POSTGRES_PASSWORD=postgres
POSTGRES_USER=postgres

# Coverage Report
ENABLE_CODE_COVERAGE_REPORT=true

# App Domain
# This is the domain that your Maybe instance will be hosted at. It is used to generate links in emails and other places.
APP_DOMAIN=
Expand Down Expand Up @@ -47,7 +50,7 @@ HOSTING_PLATFORM=localhost
# UPGRADES_MODE: Controls how the app will upgrade. `manual` means the user must manually upgrade the app. `auto` means the app will upgrade automatically (great for self-hosting)
# UPGRADES_TARGET: Controls what the app will upgrade to. `release` means the app will upgrade to the latest release. `commit` means the app will upgrade to the latest commit.
#
UPGRADES_ENABLED=false # unless editing the flow, you should keep this `false` locally in development
UPGRADES_ENABLED=false # unless editing the flow, you should keep this `false` locally in development
UPGRADES_MODE=manual # `manual` or `auto`
UPGRADES_TARGET=release # `release` or `commit`

Expand All @@ -56,15 +59,15 @@ UPGRADES_TARGET=release # `release` or `commit`
# Git Repository Module - responsible for fetching latest commit data for upgrades
# ======================================================================================================
#
GITHUB_REPO_OWNER=maybe-finance
GITHUB_REPO_OWNER=maybe-finance
GITHUB_REPO_NAME=maybe
GITHUB_REPO_BRANCH=main

# ======================================================================================================
# Active Storage Configuration - responsible for storing file uploads
# ======================================================================================================
#
# * Defaults to disk storage but you can also use Amazon S3, Google Cloud Storage, or Microsoft Azure Storage.
# * Defaults to disk storage but you can also use Amazon S3, Google Cloud Storage, or Microsoft Azure Storage.
# * Set the appropriate environment variables to use these services.
# * Ensure libvips is installed on your system for image processing - https://github.com/libvips/libvips
#
Expand All @@ -74,4 +77,4 @@ GITHUB_REPO_BRANCH=main
# S3_ACCESS_KEY_ID=
# S3_SECRET_ACCESS_KEY=
# S3_REGION= # defaults to `us-east-1` if not set
# S3_BUCKET=
# S3_BUCKET=
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@ compose-dev.yaml

# Ignore GCP keyfile
gcp-storage-keyfile.json
coverage
6 changes: 6 additions & 0 deletions .simplecov
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# frozen_string_literal: true

SimpleCov.start 'rails' do
SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter
enable_coverage :branch
end
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ group :development, :test do
gem "debug", platforms: %i[ mri windows ]
gem "brakeman", require: false
gem "rubocop-rails-omakase", require: false
gem "simplecov", require: false
gem "dotenv-rails"
gem "i18n-tasks"
gem "erb_lint"
end
Expand Down
8 changes: 8 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ GEM
debug (1.9.2)
irb (~> 1.10)
reline (>= 0.3.8)
docile (1.4.0)
dotenv (3.1.1)
dotenv-rails (3.1.1)
dotenv (= 3.1.1)
Expand Down Expand Up @@ -392,6 +393,12 @@ GEM
sentry-ruby (5.17.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
smart_properties (1.17.0)
sorbet-runtime (0.5.11367)
stackprof (0.2.26)
Expand Down Expand Up @@ -484,6 +491,7 @@ DEPENDENCIES
selenium-webdriver
sentry-rails
sentry-ruby
simplecov
stackprof
stimulus-rails
tailwindcss-rails
Expand Down
4 changes: 4 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
require "minitest/autorun"
require "mocha/minitest"

if ENV['ENABLE_CODE_COVERAGE_REPORT'] == "true"

Check failure on line 14 in test/test_helper.rb

View workflow job for this annotation

GitHub Actions / lint

Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
require 'simplecov' # Configuration details loaded from .simplecov

Check failure on line 15 in test/test_helper.rb

View workflow job for this annotation

GitHub Actions / lint

Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
end

VCR.configure do |config|
config.cassette_library_dir = "test/vcr_cassettes"
config.hook_into :webmock
Expand Down

0 comments on commit 5a333c0

Please sign in to comment.