summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-01-28 15:39:03 +0000
committerChristopher Baines <mail@cbaines.net>2019-02-14 21:38:00 +0000
commitc41fba01d3abfc1ef18dafea76f22aa05147089f (patch)
tree584cd86793e8d588a92e9188898ebd9f70a0b1c0 /gnu
parent198bc648559c2488611fe0d9c337491fbf13bd5b (diff)
downloadguix-c41fba01d3abfc1ef18dafea76f22aa05147089f.tar.gz
gnu: ruby-parallel: Begin to enable tests and update version.
* gnu/packages/ruby.scm (ruby-parallel): Update to 1.13.0.
[source]: Switch to the Git repository.
[arguments]: Change the #:test-target, and modify some phases.
[native-inputs]: Add packages required for running the tests.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/ruby.scm62
1 files changed, 54 insertions, 8 deletions
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index b06cdcc023..e491fe473a 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -36,11 +36,14 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages dbm)
+  #:use-module (gnu packages rails)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages java)
   #:use-module (gnu packages libffi)
   #:use-module (gnu packages libidn)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages lsof)
   #:use-module (gnu packages maths)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages networking)
@@ -6691,15 +6694,58 @@ interface.  It allows Jekyll to rebuild your site when a file changes.")
 (define-public ruby-parallel
   (package
     (name "ruby-parallel")
-    (version "1.12.1")
-    (source (origin
-              (method url-fetch)
-              (uri (rubygems-uri "parallel" version))
-              (sha256
-               (base32
-                "01hj8v1qnyl5ndrs33g8ld8ibk0rbcqdpkpznr04gkbxd11pqn67"))))
+    (version "1.13.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/grosser/parallel.git")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "1isqzbqxz2ndad4i5z3lb9ldrhaijfncj8bmffv04sq44sv87ikv"))))
     (build-system ruby-build-system)
-    (arguments `(#:tests? #f)); No rakefile
+    (arguments
+     `(;; TODO 3 test failures
+       ;; rspec ./spec/parallel_spec.rb:190 # Parallel.in_processes does not
+       ;; open unnecessary pipes
+       ;; rspec './spec/parallel_spec.rb[1:9:7]' # Parallel.each works with
+       ;; SQLite in processes
+       ;; rspec './spec/parallel_spec.rb[1:9:16]' # Parallel.each works with
+       ;; SQLite in threads
+       #:tests? #f
+       #:test-target "rspec-rerun:spec"
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-Gemfile
+           (lambda _
+             (substitute* "Gemfile"
+               (("gem 'rspec-legacy_formatters'") "")
+               (("gem 'activerecord.*$") "gem 'activerecord'\n"))))
+         (add-before 'check 'delete-Gemfile.lock
+           (lambda _
+             ;; Bundler isn't being used for fetching dependendencies, so
+             ;; delete the Gemfile.lock
+             (delete-file "Gemfile.lock")
+             #t))
+         (add-before 'build 'patch-gemspec
+           (lambda _
+             (substitute* "parallel.gemspec"
+               (("git ls-files") "find"))
+             #t)))))
+    (native-inputs
+     `(("ruby-rspec" ,ruby-rspec)
+       ("ruby-rspec-rerun" ,ruby-rspec-rerun)
+       ("bundler" ,bundler)
+       ("ruby-activerecord" ,ruby-activerecord)
+       ("ruby-progressbar" ,ruby-progressbar)
+       ("ruby-bump" ,ruby-bump)
+       ("procps" ,procps)
+       ("lsof" ,lsof)
+       ("ruby-mysql2" ,ruby-mysql2)
+       ("ruby-sqlite3" ,ruby-sqlite3)
+       ("ruby-i18n" ,ruby-i18n)))
     (home-page "https://github.com/grosser/parallel")
     (synopsis "Parallel processing in Ruby")
     (description "Parallel allows you to run any code in parallel Processes