Properly filter Ruby StdLib locations from backtrace.

Fixes FTBFS (rhbz#1675913).
epel9
Vít Ondruch 6 years ago
parent a6c8817d7d
commit dd56251fea

@ -0,0 +1,33 @@
From 68fae17f1439a3ad29453cf10951bd3b5131fd6f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
Date: Wed, 27 Feb 2019 15:40:37 +0100
Subject: [PATCH] Respect Ruby configuration when filtering backtrace.
The Ruby might be configured to be installed into various locations. Be
smarter about filtering backtrace to properly remove all traces of
standard library.
Fixes #1341.
---
spec/cucumber/formatter/backtrace_filter_spec.rb | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/spec/cucumber/formatter/backtrace_filter_spec.rb b/spec/cucumber/formatter/backtrace_filter_spec.rb
index f51748a5..27563a63 100644
--- a/spec/cucumber/formatter/backtrace_filter_spec.rb
+++ b/spec/cucumber/formatter/backtrace_filter_spec.rb
@@ -14,8 +14,10 @@ module Cucumber
_anything__minitest__anything_
_anything__test/unit__anything_
_anything__Xgem/ruby__anything_
- _anything__lib/ruby/__anything_
_anything__.rbenv/versions/2.3/bin/bundle__anything_)
+ trace << "_anything__#{RbConfig::CONFIG['rubyarchdir']}__anything_"
+ trace << "_anything__#{RbConfig::CONFIG['rubylibdir']}__anything_"
+
@exception = Exception.new
@exception.set_backtrace(trace)
end
--
2.20.1

@ -0,0 +1,41 @@
From 68fae17f1439a3ad29453cf10951bd3b5131fd6f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
Date: Wed, 27 Feb 2019 15:40:37 +0100
Subject: [PATCH] Respect Ruby configuration when filtering backtrace.
The Ruby might be configured to be installed into various locations. Be
smarter about filtering backtrace to properly remove all traces of
standard library.
Fixes #1341.
---
lib/cucumber/formatter/backtrace_filter.rb | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/cucumber/formatter/backtrace_filter.rb b/lib/cucumber/formatter/backtrace_filter.rb
index d0359e34..d58df52a 100644
--- a/lib/cucumber/formatter/backtrace_filter.rb
+++ b/lib/cucumber/formatter/backtrace_filter.rb
@@ -13,15 +13,17 @@ module Cucumber
minitest
test/unit
.gem/ruby
- lib/ruby/
bin/bundle
)
+
+ @backtrace_filters << RbConfig::CONFIG['rubyarchdir']
+ @backtrace_filters << RbConfig::CONFIG['rubylibdir']
if ::Cucumber::JRUBY
@backtrace_filters << 'org/jruby/'
end
- BACKTRACE_FILTER_PATTERNS = Regexp.new(@backtrace_filters.join('|'))
+ BACKTRACE_FILTER_PATTERNS = Regexp.new(@backtrace_filters.compact.join('|'))
class BacktraceFilter
def initialize(exception)
--
2.20.1

@ -1,10 +1,10 @@
%global gem_name cucumber
%{?_with_bootstrap: %global bootstrap 1}
%bcond_with bootstrap
Name: rubygem-%{gem_name}
Version: 3.1.2
Release: 4%{?dist}
Release: 5%{?dist}
Summary: Tool to execute plain-text documents as functional tests
License: MIT
URL: https://cucumber.io/
@ -18,6 +18,10 @@ Source2: %{name}-%{version}-features.tar.gz
# Fix wire protocol.
# https://github.com/cucumber/cucumber-ruby/commit/486e4fe98b93580b63b504579d99c37790f4557d
Patch0: rubygem-cucumber-3.1.2-Pass-the-registry-to-the-Wire-plugin.patch
# Properly filter Ruby StdLib locations from backtrace.
# https://github.com/cucumber/cucumber-ruby/pull/1345
Patch1: rubygem-cucumber-3.1.2-Respect-Ruby-configuration-when-filtering-backtrace.patch
Patch2: rubygem-cucumber-3.1.2-Respect-Ruby-configuration-when-filtering-backtrace-test.patch
Requires: js-jquery < 4
BuildRequires: ruby(release)
BuildRequires: rubygems-devel
@ -25,7 +29,7 @@ BuildRequires: ruby
BuildRequires: js-jquery < 4
BuildRequires: web-assets-devel
# Aruba has circular dependency with Cucumber.
%if ! 0%{?bootstrap}
%if %{without bootstrap}
BuildRequires: rubygem(aruba)
%endif
BuildRequires: rubygem(builder)
@ -60,6 +64,11 @@ Documentation for %{name}.
%gemspec_remove_file "lib/cucumber/step_argument.rb"
rm %{_builddir}/spec/cucumber/step_argument_spec.rb
%patch1 -p1
pushd %{_builddir}
%patch2 -p1
popd
# We don't have gherkin 5.1.0 in Fedora yet
%gemspec_remove_dep -s ../%{gem_name}-%{version}.gemspec -g gherkin '~> 5.1.0'
%gemspec_add_dep -s ../%{gem_name}-%{version}.gemspec -g gherkin '>= 4.1.0'
@ -99,7 +108,7 @@ sed -i '/require.*pry/ s/^/#/' spec/spec_helper.rb
rspec spec
%if ! 0%{?bootstrap}
%if %{without bootstrap}
ln -s %{_builddir}/features features
# This expects that test suite is executed from git repository.
sed -i '/Scenario: Passing feature/i\ @skip' features/docs/raketask.feature
@ -133,6 +142,9 @@ popd
%doc %{gem_instdir}/CHANGELOG.md
%changelog
* Wed Feb 27 2019 Vít Ondruch <vondruch@redhat.com> - 3.1.2-5
- Properly filter Ruby StdLib locations from backtrace.
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

Loading…
Cancel
Save