From dc2082623914ed4fde69605fab0bef2a19c7e134 Mon Sep 17 00:00:00 2001 From: Ulysse Buonomo Date: Sun, 24 Sep 2023 18:41:58 -0500 Subject: [PATCH] chore(test): add github summary --- Gemfile | 2 ++ test/cases/helper_cockroachdb.rb | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/Gemfile b/Gemfile index 8c4d1671..93b26c98 100644 --- a/Gemfile +++ b/Gemfile @@ -52,5 +52,7 @@ group :development, :test do gem "mocha", "~> 1.14.0" gem "sqlite3", "~> 1.4.4" + gem "minitest-github_action_reporter", github: "BuonOmo/minitest-github_action_reporter", require: "minitest/github_action_reporter_plugin" gem "minitest", "~> 5.15.0" + end diff --git a/test/cases/helper_cockroachdb.rb b/test/cases/helper_cockroachdb.rb index 2bcbfe24..e3d1e1da 100644 --- a/test/cases/helper_cockroachdb.rb +++ b/test/cases/helper_cockroachdb.rb @@ -2,6 +2,7 @@ Bundler.setup require "minitest/excludes" +require "minitest/github_action_reporter" # Turn on debugging for the test environment ENV['DEBUG_COCKROACHDB_ADAPTER'] = "1" @@ -9,6 +10,20 @@ # Load ActiveRecord test helper require "cases/helper" +module Minitest + module GithubActionReporterExt + def gh_link(loc) + return super unless loc.include?("/gems/") + + path, _, line = loc[%r(/(?:test|spec)/.*)][1..].rpartition(":") + + rails_version = "v#{ActiveRecord::VERSION::STRING}" + "#{ENV["GITHUB_SERVER_URL"]}/rails/rails/blob/#{rails_version}/activerecord/#{path}#L#{line}" + end + end + GithubActionReporter.prepend(GithubActionReporterExt) +end + # Load the CockroachDB specific schema. It replaces ActiveRecord's PostgreSQL # specific schema. def load_cockroachdb_specific_schema