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

Feat/8 kettle soup cover #9

Merged
merged 2 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
### External Testing Controls
export K_SOUP_COV_DO=true # Means you want code coverage
export K_SOUP_COV_MIN_BRANCH=71 # Means you want to enforce X% branch coverage
export K_SOUP_COV_MIN_LINE=89 # Means you want to enforce X% line coverage
export K_SOUP_COV_MIN_HARD=true # Means you want the build to fail if the coverage thresholds are not met
# Available formats are html, xml, rcov, lcov, json, tty
export K_SOUP_COV_MULTI_FORMATTERS="html,tty" # What coverage output formats do you want?
export MAX_ROWS=5 # Setting for simplecov-console gem for tty output, limits to the worst N rows of bad coverage
export K_SOUP_COV_COMMAND_NAME="MiniTest Coverage"
export DEBUG=true # allow byebug statements
30 changes: 2 additions & 28 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ env:
K_SOUP_COV_MIN_BRANCH: 71
K_SOUP_COV_MIN_LINE: 89
K_SOUP_COV_MIN_HARD: true
K_SOUP_COV_DO: true
K_SOUP_COV_COMMAND_NAME: "MiniTest Coverage"

on:
push:
Expand Down Expand Up @@ -45,12 +47,6 @@ jobs:
- '3.1'

steps:
- name: CodeClimate Install
uses: amancevice/setup-code-climate@v2
if: ${{ github.event_name != 'pull_request' }}
with:
cc_test_reporter_id: "${{ secrets.CC_TEST_REPORTER_ID }}"

- name: Checkout
uses: actions/checkout@v4

Expand All @@ -62,19 +58,9 @@ jobs:
bundler: "${{ matrix.bundler }}"
bundler-cache: true # runs 'bundle install' and caches installed gems automatically

- name: CodeClimate Pre-build Notification
run: cc-test-reporter before-build
if: ${{ github.event_name != 'pull_request' }}
continue-on-error: ${{ matrix.experimental != 'false' }}

- name: Run tests
run: bundle exec rake test

- name: CodeClimate Post-build Notification
run: cc-test-reporter after-build
if: ${{ github.event_name != 'pull_request' }}
continue-on-error: ${{ matrix.experimental != 'false' }}

- name: Code Coverage Summary Report
uses: irongut/[email protected]
if: ${{ github.event_name == 'pull_request' }}
Expand All @@ -97,15 +83,3 @@ jobs:
recreate: true
path: code-coverage-results.md
continue-on-error: ${{ matrix.experimental != 'false' }}

- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
continue-on-error: ${{ matrix.experimental != 'false' }}

- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: pboling/sanitize_email
1 change: 1 addition & 0 deletions .github/workflows/heads.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
strategy:
fail-fast: true
matrix:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/unsupported.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Unsupported (EOL) Ruby Matrix

env:
K_SOUP_COV_DO: false

on:
push:
branches:
Expand Down
7,997 changes: 364 additions & 7,633 deletions .rubocop_gradual.lock

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .simplecov
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
require "kettle/soup/cover/config"

SimpleCov.start
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby 3.2.5
ruby 2.7.8
13 changes: 12 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# frozen_string_literal: true

#### IMPORTANT #######################################################
# Gemfile is for local development ONLY; Gemfile is NOT loaded in CI #
####################################################### IMPORTANT ####

source "https://rubygems.org"

git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }

# Specify your gem's dependencies in ruby-openid.gemspec
gemspec

gem "byebug"
platform :mri do
# Debugging
gem "byebug", ">= 11"
end
53 changes: 45 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,23 @@ PATH
GEM
remote: https://rubygems.org/
specs:
ansi (1.5.0)
ast (2.4.2)
backports (3.25.0)
byebug (11.1.3)
diff-lcs (1.5.1)
diffy (3.4.2)
docile (1.4.1)
json (2.7.2)
kettle-soup-cover (1.0.4)
simplecov (~> 0.22)
simplecov-cobertura (~> 2.1)
simplecov-console (~> 0.9, >= 0.9.1)
simplecov-html (~> 0.12)
simplecov-lcov (~> 0.8)
simplecov-rcov (~> 0.3, >= 0.3.3)
simplecov_json_formatter (~> 0.1, >= 0.1.4)
version_gem (~> 1.1, >= 1.1.4)
language_server-protocol (3.17.0.3)
lint_roller (1.1.0)
minitest (5.25.1)
Expand All @@ -25,13 +37,13 @@ GEM
rexml (3.3.6)
strscan
rspec-block_is_expected (1.0.6)
rubocop (1.65.1)
rubocop (1.64.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.4, < 3.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
Expand Down Expand Up @@ -73,10 +85,26 @@ GEM
rubocop-thread_safety (0.5.1)
rubocop (>= 0.90.0)
ruby-progressbar (1.13.0)
standard (1.40.0)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-cobertura (2.1.0)
rexml
simplecov (~> 0.19)
simplecov-console (0.9.1)
ansi
simplecov
terminal-table
simplecov-html (0.12.3)
simplecov-lcov (0.8.0)
simplecov-rcov (0.3.7)
simplecov (>= 0.4.1)
simplecov_json_formatter (0.1.4)
standard (1.37.0)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.65.0)
rubocop (~> 1.64.0)
standard-custom (~> 1.0.0)
standard-performance (~> 1.4)
standard-custom (1.0.2)
Expand All @@ -92,16 +120,23 @@ GEM
standard-performance (>= 1.3.1, < 2)
version_gem (>= 1.1.4, < 3)
strscan (3.1.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
unicode-display_width (2.5.0)
version_gem (1.1.4)
webrick (1.8.1)
yard (0.9.36)
yard-junk (0.0.9)
backports (>= 3.18)
rainbow
yard

PLATFORMS
arm64-darwin-23
ruby
arm64-darwin-22

DEPENDENCIES
byebug
byebug (>= 11)
kettle-soup-cover (~> 1.0, >= 1.0.2)
minitest (>= 5)
rake (>= 13)
rexml (~> 3.2)
Expand All @@ -111,6 +146,8 @@ DEPENDENCIES
ruby-openid!
standard (>= 1.35.1)
webrick (~> 1.8)
yard (~> 0.9, >= 0.9.34)
yard-junk (~> 0.0)

BUNDLED WITH
2.5.18
2.4.22
12 changes: 6 additions & 6 deletions bin/bundle
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ m = Module.new do
bundler_version = nil
update_index = nil
ARGV.each_with_index do |a, i|
if update_index && update_index.succ == i && a.match?(Gem::Version::ANCHORED_VERSION_PATTERN)
if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
bundler_version = a
end
next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/o
bundler_version = $1
update_index = i
end
Expand All @@ -56,7 +56,7 @@ m = Module.new do
def lockfile_version
return unless File.file?(lockfile)
lockfile_contents = File.read(lockfile)
return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/o
Regexp.last_match(1)
end

Expand All @@ -83,15 +83,15 @@ m = Module.new do

def activate_bundler
gem_error = activation_error_handling do
gem "bundler", bundler_requirement
gem("bundler", bundler_requirement)
end
return if gem_error.nil?
require_error = activation_error_handling do
require "bundler/version"
end
return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
exit 42
warn("Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`")
exit(42)
end

def activation_error_handling
Expand Down
27 changes: 27 additions & 0 deletions bin/code_climate_reek
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
# The application 'code_climate_reek' is installed as part of a gem, and
# this file is here to facilitate running it.
#

ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

bundle_binstub = File.expand_path("bundle", __dir__)

if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end

require "rubygems"
require "bundler/setup"

load Gem.bin_path("reek", "code_climate_reek")
27 changes: 27 additions & 0 deletions bin/reek
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
# The application 'reek' is installed as part of a gem, and
# this file is here to facilitate running it.
#

ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

bundle_binstub = File.expand_path("bundle", __dir__)

if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end

require "rubygems"
require "bundler/setup"

load Gem.bin_path("reek", "reek")
27 changes: 27 additions & 0 deletions bin/yard
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
# The application 'yard' is installed as part of a gem, and
# this file is here to facilitate running it.
#

ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

bundle_binstub = File.expand_path("bundle", __dir__)

if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end

require "rubygems"
require "bundler/setup"

load Gem.bin_path("yard", "yard")
27 changes: 27 additions & 0 deletions bin/yard-junk
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
# The application 'yard-junk' is installed as part of a gem, and
# this file is here to facilitate running it.
#

ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

bundle_binstub = File.expand_path("bundle", __dir__)

if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end

require "rubygems"
require "bundler/setup"

load Gem.bin_path("yard-junk", "yard-junk")
27 changes: 27 additions & 0 deletions bin/yardoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
# The application 'yardoc' is installed as part of a gem, and
# this file is here to facilitate running it.
#

ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

bundle_binstub = File.expand_path("bundle", __dir__)

if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end

require "rubygems"
require "bundler/setup"

load Gem.bin_path("yard", "yardoc")
Loading
Loading