From c91cc5fc425dd2a9066c8f50bfe014beeb06641e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?= Date: Sun, 5 Jan 2025 11:49:18 +0100 Subject: [PATCH 1/2] build: add ruby version to matrix --- .github/workflows/nightly-unit-tests.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nightly-unit-tests.yaml b/.github/workflows/nightly-unit-tests.yaml index 002c4a35..25d40456 100644 --- a/.github/workflows/nightly-unit-tests.yaml +++ b/.github/workflows/nightly-unit-tests.yaml @@ -11,6 +11,7 @@ jobs: max-parallel: 4 matrix: # Run acceptance tests all supported combinations of Ruby and ActiveRecord. + ruby: ["3.1", "3.2", "3.3"] ar: ["~> 6.1.0", "~> 7.0.0", "~> 7.1.0", "~> 7.2.0", "~> 8.0.0"] # Exclude combinations that are not supported. exclude: From 4dcd05095060e0d2290e2e88ba167ac29c230227 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?= Date: Fri, 10 Jan 2025 09:40:08 +0100 Subject: [PATCH 2/2] chore: collect test code coverage --- Gemfile | 3 ++- acceptance/test_helper.rb | 8 ++++++++ test/test_helper.rb | 7 +++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 607c61ac..d2adedf6 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ source "https://rubygems.org" # Specify your gem's dependencies in activerecord-spanner.gemspec gemspec -ar_version = ENV.fetch("AR_VERSION", "~> 7.1.0") +ar_version = ENV.fetch("AR_VERSION", "~> 7.2.0") gem "activerecord", ar_version gem "ostruct" gem "minitest", "~> 5.25.0" @@ -17,6 +17,7 @@ gem 'sqlite3' install_if -> { ar_version.dup.to_s.sub("~>", "").strip < "7.1.0" && !ENV["SKIP_COMPOSITE_PK"] } do gem "composite_primary_keys" end +gem 'simplecov', require: false, group: :test # Required for samples gem "docker-api" diff --git a/acceptance/test_helper.rb b/acceptance/test_helper.rb index de45dbbd..a0c2cae4 100644 --- a/acceptance/test_helper.rb +++ b/acceptance/test_helper.rb @@ -4,6 +4,14 @@ # license that can be found in the LICENSE file or at # https://opensource.org/licenses/MIT. +require 'simplecov' +SimpleCov.start do + add_filter '/test/' + add_filter '/acceptance/' + add_filter '/benchmarks/' +end + +# Previous content of test helper now starts here gem "minitest" require "minitest/autorun" require "minitest/focus" diff --git a/test/test_helper.rb b/test/test_helper.rb index 965b1106..913111d3 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -4,6 +4,13 @@ # license that can be found in the LICENSE file or at # https://opensource.org/licenses/MIT. +require 'simplecov' +SimpleCov.start do + add_filter '/test/' + add_filter '/acceptance/' + add_filter '/benchmarks/' +end + require "minitest/autorun" require "minitest/focus" require "minitest/rg"