Skip to content
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
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ jobs:

- name: Run tests
run: bundle exec rake test
env:
LIZARD_REPORT: ${{ matrix.ruby-version == '4.0' && 'true' || 'false' }}
LIZARD_API_KEY: ${{ secrets.LIZARD_API_KEY }}
LIZARD_URL: ${{ secrets.LIZARD_URL }}

- name: Upload coverage reports
uses: codecov/codecov-action@v5.5.2
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Lizard test reporting in CI and Minitest reporter plugin in test_helper

### Removed

- Ruby 3.2 support; minimum is now 3.3
Expand Down
24 changes: 12 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ GEM
docile (1.4.1)
drb (2.2.3)
hashdiff (1.2.1)
json (2.15.2)
json (2.19.2)
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
minitest (6.0.2)
Expand All @@ -26,7 +26,7 @@ GEM
mocha (3.1.0)
ruby2_keywords (>= 0.0.5)
parallel (1.27.0)
parser (3.3.10.0)
parser (3.3.10.2)
ast (~> 2.4.1)
racc
prism (1.9.0)
Expand All @@ -49,24 +49,24 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.7)
rubocop (1.80.2)
rubocop (1.84.2)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.46.0, < 2.0)
rubocop-ast (>= 1.49.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.47.1)
rubocop-ast (1.49.1)
parser (>= 3.3.7.2)
prism (~> 1.4)
rubocop-performance (1.25.0)
prism (~> 1.7)
rubocop-performance (1.26.1)
lint_roller (~> 1.1)
rubocop (>= 1.75.0, < 2.0)
rubocop-ast (>= 1.38.0, < 2.0)
rubocop-ast (>= 1.47.1, < 2.0)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
simplecov (0.22.0)
Expand All @@ -75,18 +75,18 @@ GEM
simplecov_json_formatter (~> 0.1)
simplecov-html (0.13.2)
simplecov_json_formatter (0.1.4)
standard (1.51.1)
standard (1.54.0)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.80.2)
rubocop (~> 1.84.0)
standard-custom (~> 1.0.0)
standard-performance (~> 1.8)
standard-custom (1.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.50)
standard-performance (1.8.0)
standard-performance (1.9.0)
lint_roller (~> 1.1)
rubocop-performance (~> 1.25.0)
rubocop-performance (~> 1.26.0)
standardrb (1.0.1)
standard
unicode-display_width (3.2.0)
Expand Down
9 changes: 7 additions & 2 deletions test/client_test.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
require "test_helper"

class ClientTest < Minitest::Test
LIZARD_ENV_KEYS = %w[LIZARD_API_KEY LIZARD_URL].freeze

def setup
@original_env = LIZARD_ENV_KEYS.to_h { |k| [k, ENV[k]] }
end

def teardown
Lizard.api_key = nil
Lizard.url = nil
ENV.delete("LIZARD_API_KEY")
ENV.delete("LIZARD_URL")
LIZARD_ENV_KEYS.each { |k| ENV[k] = @original_env[k] }
end

def test_initialize_accepts_parameters
Expand Down
8 changes: 4 additions & 4 deletions test/minitest_reporter_test.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
require "test_helper"

class MinitestReporterTest < Minitest::Test
LIZARD_ENV_KEYS = %w[LIZARD_TEST_MODE LIZARD_API_KEY LIZARD_URL LIZARD_REPORT].freeze

def setup
@original_env = LIZARD_ENV_KEYS.to_h { |k| [k, ENV[k]] }
@reporter = Lizard::MinitestReporter.new
end

def teardown
ENV.delete("LIZARD_TEST_MODE")
ENV.delete("LIZARD_API_KEY")
ENV.delete("LIZARD_URL")
ENV.delete("LIZARD_REPORT")
LIZARD_ENV_KEYS.each { |k| ENV[k] = @original_env[k] }
end

def test_inherits_from_minitest_statistics_reporter
Expand Down
8 changes: 4 additions & 4 deletions test/rspec_formatter_test.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
require "test_helper"

class RSpecFormatterTest < Minitest::Test
LIZARD_ENV_KEYS = %w[LIZARD_TEST_MODE LIZARD_API_KEY LIZARD_URL LIZARD_REPORT].freeze

def setup
@original_env = LIZARD_ENV_KEYS.to_h { |k| [k, ENV[k]] }
@output = StringIO.new
@formatter = Lizard::RSpecFormatter.new(@output)
end

def teardown
ENV.delete("LIZARD_TEST_MODE")
ENV.delete("LIZARD_API_KEY")
ENV.delete("LIZARD_URL")
ENV.delete("LIZARD_REPORT")
LIZARD_ENV_KEYS.each { |k| ENV[k] = @original_env[k] }
end

def test_inherits_from_rspec_base_formatter
Expand Down
8 changes: 8 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,11 @@
require "lizard"
require "minitest/autorun"
require "mocha/minitest"

Minitest.extensions << "lizard"

module Minitest
def self.plugin_lizard_init(options)
reporter << Lizard::MinitestReporter.new(options[:io], options)
end
end
Loading