Prefer upstream patch for the previous change

This commit is contained in:
Mamoru TASAKA 2023-08-06 16:56:23 +09:00
parent 373e0fdada
commit 1569bb6157
2 changed files with 75 additions and 17 deletions

View File

@ -0,0 +1,62 @@
From a29042b0c0dbdc1b488a97dd6d6dd88d4b583c05 Mon Sep 17 00:00:00 2001
From: Mike Dalessio <mike.dalessio@gmail.com>
Date: Thu, 3 Aug 2023 17:52:36 -0400
Subject: [PATCH 2/3] style: prefer Minitest to MiniTest
since Minitest 5.19 doesn't load it by default
---
.github/ISSUE_TEMPLATE/1-bug-report.md | 2 +-
CONTRIBUTING.md | 2 +-
test/helper.rb | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.github/ISSUE_TEMPLATE/1-bug-report.md b/.github/ISSUE_TEMPLATE/1-bug-report.md
index 297cd4de42..79d4bf6ff1 100644
--- a/.github/ISSUE_TEMPLATE/1-bug-report.md
+++ b/.github/ISSUE_TEMPLATE/1-bug-report.md
@@ -32,7 +32,7 @@ Here's an example of how you might structure such a script:
require 'nokogiri'
require 'minitest/autorun'
-class Test < MiniTest::Spec
+class Test < Minitest::Spec
describe "Node#css" do
it "should find a div using chained classes" do
html = <<~HEREDOC
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 336c9c5c14..a0f844d16e 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -124,7 +124,7 @@ Note that `rake test` does not compile the native extension, and this is intenti
bundle exec rake compile test
```
-To run a focused test, use MiniTest's `TESTOPTS`:
+To run a focused test, use Minitest's `TESTOPTS`:
``` sh
bundle exec rake compile test TESTOPTS="-n/test_last_element_child/"
diff --git a/test/helper.rb b/test/helper.rb
index ed3133c6e8..8d4569e87c 100644
--- a/test/helper.rb
+++ b/test/helper.rb
@@ -128,7 +128,7 @@ class TestBenchmark < Minitest::BenchSpec
end
# rubocop:disable Style/ClassVars
- class TestCase < MiniTest::Spec
+ class TestCase < Minitest::Spec
include TestBase
COMPACT_EVERY = 20
@@ -272,7 +272,7 @@ def assert_not_send(send_ary, m = nil)
def pending(msg)
begin
yield
- rescue MiniTest::Assertion
+ rescue Minitest::Assertion
skip("pending #{msg} [#{caller(2..2).first}]")
end
flunk("pending test unexpectedly passed: #{msg} [#{caller(1..1).first}]")

View File

@ -1,7 +1,7 @@
%global mainver 1.15.3 %global mainver 1.15.3
#%%global prever .rc4 #%%global prever .rc4
%global baserelease 3 %global baserelease 4
%global prerpmver %(echo "%{?prever}" | sed -e 's|\\.||g') %global prerpmver %(echo "%{?prever}" | sed -e 's|\\.||g')
%global gem_name nokogiri %global gem_name nokogiri
@ -29,6 +29,8 @@ Source1: rubygem-%{gem_name}-%{version}%{?prever}-full.tar.gz
Source2: nokogiri-create-full-tarball.sh Source2: nokogiri-create-full-tarball.sh
# Shut down libxml2 version unmatching warning # Shut down libxml2 version unmatching warning
Patch0: %{name}-1.11.0.rc4-shutdown-libxml2-warning.patch Patch0: %{name}-1.11.0.rc4-shutdown-libxml2-warning.patch
# https://github.com/sparklemotion/nokogiri/pull/2938
Patch1: %{gem_name}-pr2938-minitest-5_19.patch
BuildRequires: ruby(release) BuildRequires: ruby(release)
BuildRequires: ruby(rubygems) BuildRequires: ruby(rubygems)
## ##
@ -76,10 +78,12 @@ This package provides non-Gem support for %{gem_name}.
%prep %prep
%setup -q -n %{gem_name}-%{version} -a 1 %setup -q -n %{gem_name}-%{version} -a 1
cp -a %{gem_name}-%{version}/{.,*} .
mv ../%{gem_name}-%{version}.gemspec . mv ../%{gem_name}-%{version}.gemspec .
# patches # patches
%patch -P0 -p1 %patch -P0 -p1
%patch -P1 -p1
# remove bundled external libraries # remove bundled external libraries
sed -i \ sed -i \
@ -109,11 +113,6 @@ sed -i \
gumbo-parser/src/Makefile \ gumbo-parser/src/Makefile \
-e 's|^\(CFLAGS.*=.*\)$|\1 -fPIC|' -e 's|^\(CFLAGS.*=.*\)$|\1 -fPIC|'
# MiniTest 5.19+
%if 0%{?fedora} >= 39
grep -rl MiniTest nokogiri-*/test/ | xargs sed -i 's|MiniTest::|Minitest::|'
%endif
%build %build
# Ummm... # Ummm...
env LANG=C.UTF-8 gem build %{gem_name}-%{version}.gemspec env LANG=C.UTF-8 gem build %{gem_name}-%{version}.gemspec
@ -170,7 +169,7 @@ do
done done
# Copy document files from full source # Copy document files from full source
cp -p %{gem_name}-%{version}/[A-Z]* %{buildroot}%{gem_instdir}/ cp -p [A-Z]* %{buildroot}%{gem_instdir}/
# cleanups # cleanups
# Remove bundled gumbo parser # Remove bundled gumbo parser
@ -186,10 +185,9 @@ rm -rf \
ports \ ports \
%{nil} %{nil}
pushd gumbo-parser pushd gumbo-parser
rm \ find . -type f | \
Makefile \ grep -v CHANGES.md | \
%{nil} grep -v THANKS | \
find src -type f | \
grep -v README.md | \ grep -v README.md | \
xargs rm -f xargs rm -f
@ -205,7 +203,7 @@ export TZ="Asia/Tokyo"
LANG=C.UTF-8 LANG=C.UTF-8
# Copy test files from full tarball # Copy test files from full tarball
cp -a %{gem_name}-%{version}/test/ ./%{gem_instdir} cp -a test/ ./%{gem_instdir}
pushd ./%{gem_instdir} pushd ./%{gem_instdir}
# Remove unneeded simplecov coverage test # Remove unneeded simplecov coverage test
@ -220,11 +218,6 @@ sed -i '/Minitest::Reporters/ s/^/#/' test/helper.rb
# PPC64LE with ruby3.1 does not seem to support GC.compact # PPC64LE with ruby3.1 does not seem to support GC.compact
%ifarch ppc64le %ifarch ppc64le
export NOKOGIRI_TEST_GC_LEVEL=major export NOKOGIRI_TEST_GC_LEVEL=major
# F36 ruby has not implemented runtime GC compaction support yet
# c.f https://src.fedoraproject.org/rpms/ruby/pull-request/126
%if 0%{?fedora} <= 36
sed -i test/test_compaction.rb -e 's|skip unless GC.respond_to.*|skip|'
%endif
%endif %endif
%ifarch s390x %ifarch s390x
# With ruby 3.2 GC_LEVEL=compact seems to cause segfault: # With ruby 3.2 GC_LEVEL=compact seems to cause segfault:
@ -276,6 +269,9 @@ popd
%doc %{gem_dir}/doc/%{gem_name}-%{mainver}%{?prever}/ %doc %{gem_dir}/doc/%{gem_name}-%{mainver}%{?prever}/
%changelog %changelog
* Sun Aug 6 2023 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.15.3-4
- Prefer upstream patch for the previous change
* Fri Aug 4 2023 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.15.3-3 * Fri Aug 4 2023 Mamoru TASAKA <mtasaka@fedoraproject.org> - 1.15.3-3
- Support MiniTest 5.19+ - Support MiniTest 5.19+