Subject: [bug#76314] [PATCH ruby-team 40/71] gnu: ruby-actionpack: Patch source.

From: Nicolas Graves <[email-masked]>
Date: Sun, 16 Feb 2025 01:34:08 +0100

* gnu/packages/patches/ruby-actionpack-remove-browser-tests.patch: Add
patch.
* gnu/local.mk: Record patch.
* gnu/packages/rails.scm (ruby-rails-monorepo): Apply patch.
---
 gnu/local.mk                                  |  1 +
 ...ruby-actionpack-remove-browser-tests.patch | 33 +++++++++++++++++++
 gnu/packages/rails.scm                        |  5 ++-
 3 files changed, 38 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/ruby-actionpack-remove-browser-tests.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 6b457b57ec..a6e10263ff 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2178,6 +2178,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/rocm-comgr-3.1.0-dependencies.patch 	\
   %D%/packages/patches/rocm-opencl-runtime-4.3-noclinfo.patch 	\
   %D%/packages/patches/rottlog-direntry.patch 			\
+  %D%/packages/patches/ruby-actionpack-remove-browser-tests.patch	\
   %D%/packages/patches/ruby-hiredis-use-system-hiredis.patch	\
   %D%/packages/patches/ruby-hydra-minimal-no-byebug.patch	\
   %D%/packages/patches/ruby-anystyle-data-immutable-install.patch	\
diff --git a/gnu/packages/patches/ruby-actionpack-remove-browser-tests.patch b/gnu/packages/patches/ruby-actionpack-remove-browser-tests.patch
new file mode 100644
index 0000000000..647bf16a2a
--- /dev/null
+++ b/gnu/packages/patches/ruby-actionpack-remove-browser-tests.patch
@@ -0,0 +1,33 @@
+From 02e8665d5ad910807d567536199f81d8e5aa8bce Mon Sep 17 00:00:00 2001
+From: Nicolas Graves <[email-masked]>
+Date: Mon, 20 Jan 2025 04:48:10 +0100
+Subject: [PATCH] Remove abstract units depending on a read browser.
+
+---
+ actionpack/test/abstract_unit.rb | 12 ------------
+ 1 file changed, 12 deletions(-)
+
+diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb
+index 1ab8ea73ab..32ffba71a9 100644
+--- a/actionpack/test/abstract_unit.rb
++++ b/actionpack/test/abstract_unit.rb
+@@ -519,16 +519,4 @@ class DrivenByRackTest < ActionDispatch::SystemTestCase
+   driven_by :rack_test
+ end
+ 
+-class DrivenBySeleniumWithChrome < ActionDispatch::SystemTestCase
+-  driven_by :selenium, using: :chrome
+-end
+-
+-class DrivenBySeleniumWithHeadlessChrome < ActionDispatch::SystemTestCase
+-  driven_by :selenium, using: :headless_chrome
+-end
+-
+-class DrivenBySeleniumWithHeadlessFirefox < ActionDispatch::SystemTestCase
+-  driven_by :selenium, using: :headless_firefox
+-end
+-
+ require_relative "../../tools/test_common"
+-- 
+2.47.1
+
diff --git a/gnu/packages/rails.scm b/gnu/packages/rails.scm
index 772253ad05..8fd80d33bb 100644
--- a/gnu/packages/rails.scm
+++ b/gnu/packages/rails.scm
@@ -27,6 +27,7 @@
   #:use-module (guix git-download)
   #:use-module (guix packages)
   #:use-module (guix utils)
+  #:use-module (gnu packages)
   #:use-module (gnu packages base)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages node)
@@ -46,7 +47,9 @@
     (file-name (git-file-name "ruby-rails" %ruby-rails-version))
     (sha256
      (base32
-      "0wzlnfs3k6ahhzcqznk43y1lq8a3dq3i7q1aqracx891hjmr19n2"))))
+      "0wzlnfs3k6ahhzcqznk43y1lq8a3dq3i7q1aqracx891hjmr19n2"))
+    (patches
+     (search-patches "ruby-actionpack-remove-browser-tests.patch"))))
 
 (define-public ruby-activesupport
   (package
-- 
2.48.1