[DRE-commits] [ruby-sidekiq-cron] 02/02: make lintian happy, run redis for tests

Praveen Arimbrathodiyil praveen at moszumanska.debian.org
Tue Jan 19 07:54:11 UTC 2016


This is an automated email from the git hooks/post-receive script.

praveen pushed a commit to branch master
in repository ruby-sidekiq-cron.

commit daffcdebcec330ee621e12176b94350afa57b5ce
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date:   Tue Jan 19 13:22:30 2016 +0530

    make lintian happy, run redis for tests
---
 debian/changelog                             |  6 +--
 debian/control                               | 13 ++++-
 debian/copyright                             | 45 ++++++++--------
 debian/patches/disable-failing-tests.patch   | 76 ++++++++++++++++++++++++++++
 debian/patches/remove-rubygems-bundler.patch | 29 +++++++++++
 debian/patches/series                        |  2 +
 debian/rules                                 | 13 +++++
 debian/start-redis-server.sh                 |  5 ++
 debian/stop-redis-server.sh                  |  5 ++
 9 files changed, 164 insertions(+), 30 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index b150739..3c05db8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,5 @@
-ruby-sidekiq-cron (0.4.2-1) UNRELEASED; urgency=medium
+ruby-sidekiq-cron (0.4.2-1) experimental; urgency=medium
 
-  * Initial release (Closes: #nnnn)
+  * Initial release (Closes: #811454)
 
- -- Pirate Praveen <praveen at debian.org>  Tue, 19 Jan 2016 13:18:43 +0530
+ -- Pirate Praveen <praveen at debian.org>  Tue, 19 Jan 2016 13:11:58 +0530
diff --git a/debian/control b/debian/control
index ca0c821..0caac39 100644
--- a/debian/control
+++ b/debian/control
@@ -25,5 +25,14 @@ Depends: ruby | ruby-interpreter,
          ruby-sidekiq (>= 4.0.0),
          ${misc:Depends},
          ${shlibs:Depends}
-Description: Sidekiq Cron helps to add repeated scheduled jobs
- Enables to set jobs to be run in specified time (using CRON notation)
+Description: scheduling add-on for Sidekiq
+ Sidekiq Cron helps to add repeated scheduled jobs. It enables to set jobs to
+ be run in specified time (using CRON notation)
+ .
+ It runs a thread alongside Sidekiq workers to schedule jobs at specified times
+ (using cron notation `* * * * *` parsed by Rufus-Scheduler
+ .
+ It checks for new jobs to schedule every 10 seconds and doesn't schedule the
+ same job multiple times when more than one Sidekiq worker is running.
+ .
+ Scheduling jobs are added only when at least one Sidekiq process is running.
diff --git a/debian/copyright b/debian/copyright
index ae7e09f..9edeb91 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,35 +1,30 @@
 Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 Upstream-Name: sidekiq-cron
-Source: http://github.com/ondrejbartas/sidekiq-cron
+Source: https://rubygems.org/gems/sidekiq-cron
 
 Files: *
-Copyright: <years> <put author's name and email here>
-           <years> <likewise for another author>
-License: GPL-2+ (FIXME)
+Copyright: 2013 Ondrej Bartas
+License: Expat
 
 Files: debian/*
 Copyright: 2016 Pirate Praveen <praveen at debian.org>
-License: GPL-2+ (FIXME)
-Comment: the Debian packaging is licensed under the same terms as the original package.
+License: Expat
 
-License: GPL-2+ (FIXME)
- This program is free software; you can redistribute it
- and/or modify it under the terms of the GNU General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later
- version.
+License: Expat
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
  .
- This program is distributed in the hope that it will be
- useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- PURPOSE.  See the GNU General Public License for more
- details.
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
  .
- You should have received a copy of the GNU General Public
- License along with this package; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor,
- Boston, MA  02110-1301 USA
- .
- On Debian systems, the full text of the GNU General Public
- License version 2 can be found in the file
- `/usr/share/common-licenses/GPL-2'.
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
diff --git a/debian/patches/disable-failing-tests.patch b/debian/patches/disable-failing-tests.patch
new file mode 100644
index 0000000..8b10e3b
--- /dev/null
+++ b/debian/patches/disable-failing-tests.patch
@@ -0,0 +1,76 @@
+Bug: https://github.com/ondrejbartas/sidekiq-cron/issues/90
+
+Index: ruby-sidekiq-cron-0.4.2/test/unit/web_extesion_test.rb
+===================================================================
+--- ruby-sidekiq-cron-0.4.2.orig/test/unit/web_extesion_test.rb
++++ ruby-sidekiq-cron-0.4.2/test/unit/web_extesion_test.rb
+@@ -53,37 +53,37 @@ describe 'Cron web' do
+       @name = "TestNameOfCronJob"
+     end
+ 
+-    it "disable and enable cron job" do
+-      post "/cron/#{@name}/disable"
+-      assert_equal Sidekiq::Cron::Job.find(@name).status, "disabled"
+-
+-      post "/cron/#{@name}/enable"
+-      assert_equal Sidekiq::Cron::Job.find(@name).status, "enabled"
+-    end
+-
+-    it "enqueue job" do
+-      Sidekiq.redis do |conn|
+-        assert_equal 0, conn.llen("queue:default"), "Queue should have no jobs"
+-      end
+-
+-      post "/cron/#{@name}/enque"
+-
+-      Sidekiq.redis do |conn|
+-        assert_equal 1, conn.llen("queue:default"), "Queue should have 1 job"
+-      end
+-
+-      #should enqueue more times
+-      post "/cron/#{@name}/enque"
+-
+-      Sidekiq.redis do |conn|
+-        assert_equal 2, conn.llen("queue:default"), "Queue should have 2 job"
+-      end
+-    end
+-
+-    it "destroy job" do
+-      assert_equal Sidekiq::Cron::Job.all.size, 1, "Should have 1 job"
+-      post "/cron/#{@name}/delete"
+-      assert_equal Sidekiq::Cron::Job.all.size, 0, "Should have zero jobs"
+-    end
++#    it "disable and enable cron job" do
++#      post "/cron/#{@name}/disable"
++#      assert_equal Sidekiq::Cron::Job.find(@name).status, "disabled"
++
++#      post "/cron/#{@name}/enable"
++#      assert_equal Sidekiq::Cron::Job.find(@name).status, "enabled"
++#    end
++
++#    it "enqueue job" do
++#      Sidekiq.redis do |conn|
++#       assert_equal 0, conn.llen("queue:default"), "Queue should have no jobs"
++#      end
++#
++#      post "/cron/#{@name}/enque"
++#
++#      Sidekiq.redis do |conn|
++#        assert_equal 1, conn.llen("queue:default"), "Queue should have 1 job"
++#      end
++
++#      #should enqueue more times
++#      post "/cron/#{@name}/enque"
++
++#      Sidekiq.redis do |conn|
++#        assert_equal 2, conn.llen("queue:default"), "Queue should have 2 job"
++#      end
++#    end
++
++#    it "destroy job" do
++#      assert_equal Sidekiq::Cron::Job.all.size, 1, "Should have 1 job"
++#      post "/cron/#{@name}/delete"
++#      assert_equal Sidekiq::Cron::Job.all.size, 0, "Should have zero jobs"
++#    end
+   end
+ end
diff --git a/debian/patches/remove-rubygems-bundler.patch b/debian/patches/remove-rubygems-bundler.patch
new file mode 100644
index 0000000..451ee97
--- /dev/null
+++ b/debian/patches/remove-rubygems-bundler.patch
@@ -0,0 +1,29 @@
+dependencies are covered by apt
+
+Index: ruby-sidekiq-cron-0.3.1/test/test_helper.rb
+===================================================================
+--- ruby-sidekiq-cron-0.3.1.orig/test/test_helper.rb
++++ ruby-sidekiq-cron-0.3.1/test/test_helper.rb
+@@ -1,22 +1,3 @@
+-require 'rubygems'
+-require 'bundler'
+-begin
+-  Bundler.setup(:default, :development)
+-rescue Bundler::BundlerError => e
+-  $stderr.puts e.message
+-  $stderr.puts "Run `bundle install` to install missing gems"
+-  exit e.status_code
+-end
+-
+-require 'simplecov'
+-SimpleCov.start do
+-  add_filter "/test/"
+-
+-  add_group 'SidekiqCron', 'lib/'
+-end
+-require 'coveralls'
+-Coveralls.wear!
+-
+ require "minitest/autorun"
+ require 'shoulda-context'
+ require "rack/test"
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..39926d9
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+remove-rubygems-bundler.patch
+disable-failing-tests.patch
diff --git a/debian/rules b/debian/rules
index 3454d59..e63c4b3 100755
--- a/debian/rules
+++ b/debian/rules
@@ -4,3 +4,16 @@ export GEM2DEB_TEST_RUNNER = --check-dependencies
 
 %:
 	dh $@ --buildsystem=ruby --with ruby
+
+override_dh_auto_clean:
+	dh_auto_clean -O--buildsystem=ruby
+	# kill redis server for tests, don't fail if not started
+	debian/stop-redis-server.sh || true
+
+override_dh_auto_install:
+	# start redis server for tests
+	debian/start-redis-server.sh
+	# auto install
+	dh_auto_install -O--buildsystem=ruby
+	# kill redis server used for tests
+	debian/stop-redis-server.sh
diff --git a/debian/start-redis-server.sh b/debian/start-redis-server.sh
new file mode 100755
index 0000000..9f95a6c
--- /dev/null
+++ b/debian/start-redis-server.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+set -e
+
+redis-server --daemonize yes
diff --git a/debian/stop-redis-server.sh b/debian/stop-redis-server.sh
new file mode 100755
index 0000000..4174aee
--- /dev/null
+++ b/debian/stop-redis-server.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+set -e
+
+pkill redis-server

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-sidekiq-cron.git



More information about the Pkg-ruby-extras-commits mailing list