[DRE-commits] [rails] 02/13: Run tests

Antonio Terceiro terceiro at moszumanska.debian.org
Fri Mar 4 18:31:27 UTC 2016


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

terceiro pushed a commit to branch master
in repository rails.

commit 057bb04d593052f184848f7d44eb9c0dd4b9209d
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Thu Mar 3 16:32:00 2016 -0300

    Run tests
---
 debian/changelog     |  3 +++
 debian/control       | 45 +++++++++++++++++++++++++++++++++++++++++++--
 debian/ruby-tests.rb | 44 ++++++++++++++++++++++++++++++++++++++++++++
 debian/tests/control |  3 +++
 4 files changed, 93 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 6b20185..8966ef4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,9 @@ rails (2:4.2.5.2-2) UNRELEASED; urgency=medium
 
   * 0002-load_paths.rb-don-t-load-bundler.patch: don't load bundler when
     running tests
+  * Run tests during build
+    - add all runtime dependencies as build dependencies as well
+  * Run unit tests also under autopkgtest
 
  -- Antonio Terceiro <terceiro at debian.org>  Thu, 03 Mar 2016 16:31:21 -0300
 
diff --git a/debian/control b/debian/control
index ce106a7..05197f0 100644
--- a/debian/control
+++ b/debian/control
@@ -4,8 +4,49 @@ Priority: optional
 Maintainer: Debian Ruby Extras Maintainers <pkg-ruby-extras-maintainers at lists.alioth.debian.org>
 Uploaders: Antonio Terceiro <terceiro at debian.org>
 Build-Depends: debhelper (>= 9),
-               gem2deb,
-               racc
+               gem2deb (>= 0.4.0~),
+               rake,
+               rake (>= 0.8.7),
+               ruby-arel (>= 6.0),
+               ruby-arel (<< 7.0),
+               ruby-bcrypt,
+               ruby-builder (>= 3.1),
+               ruby-builder (<< 4.0),
+               ruby-bundler (>= 1.3.0),
+               ruby-bundler (<< 2.0),
+               ruby-dalli,
+               ruby-delayed-job,
+               ruby-erubis (>= 2.7.0),
+               ruby-erubis (<< 2.8),
+               ruby-globalid,
+               ruby-i18n (>= 0.7),
+               ruby-i18n (<< 1.0),
+               ruby-json (>= 1.7.7),
+               ruby-json (<< 2.0),
+               ruby-mail (>= 2.5.4),
+               ruby-minitest (>= 5.1),
+               ruby-minitest (<< 6.0),
+               ruby-mocha,
+               ruby-mysql2,
+               ruby-rack (>= 1.6),
+               ruby-rack (<< 2.0),
+               ruby-rack-cache,
+               ruby-rack-test (>= 0.6.2),
+               ruby-rack-test (<< 0.7),
+               ruby-rails-dom-testing (>= 1.0.5),
+               ruby-rails-dom-testing (<< 2.0),
+               ruby-rails-html-sanitizer (>= 1.0.2),
+               ruby-rails-html-sanitizer (<< 2.0),
+               ruby-sprockets-rails (>= 2.1.3-1~),
+               ruby-sprockets-rails (<< 3.0),
+               ruby-sqlite3,
+               ruby-thor (>= 0.18.1),
+               ruby-thor (<< 2.0),
+               ruby-thread-safe (>= 0.3.4),
+               ruby-thread-safe (<< 1.0),
+               ruby-treetop,
+               ruby-tzinfo (>= 1.1),
+               ruby-tzinfo (<< 2.0),
 Standards-Version: 3.9.7
 Vcs-Git: https://anonscm.debian.org/git/pkg-ruby-extras/rails.git
 Vcs-Browser: https://anonscm.debian.org/cgit/pkg-ruby-extras/rails.git
diff --git a/debian/ruby-tests.rb b/debian/ruby-tests.rb
new file mode 100644
index 0000000..7eb49ac
--- /dev/null
+++ b/debian/ruby-tests.rb
@@ -0,0 +1,44 @@
+def run(cmd)
+  puts cmd
+  system 'mv lib lib.off'
+  res = system(cmd)
+  system 'mv lib.off lib'
+  res
+end
+
+ruby = RbConfig::CONFIG['ruby_install_name']
+
+puts
+puts '[Debian Build]'
+puts '========================================================================'
+
+results = {}
+{
+  'actionmailer'  => 'test',
+  'actionpack'    => 'test',
+  'actionview'    => 'test',
+  #'activejob'     => 'test', # FIXME MISSING DEPENDENCIES
+  'activemodel'   => 'test',
+  #'activerecord'  => 'test:sqlite3', # FIXME BROKEN
+  #'activesupport' => 'test', # FIXME BROKEN
+  #'railties'      => 'test', # FIXME BROKEN
+}.each do |component,tasks|
+  Array(tasks).each do |task|
+    Dir.chdir component do
+      banner = [component, task].join(' ')
+      puts
+      puts banner
+      puts banner.gsub(/./, '-')
+      puts
+
+      puts "cd #{component}"
+      results["#{component}:#{task}"] = run("#{ruby} -S rake #{task}")
+      puts 'cd -'
+    end
+  end
+end
+
+if results.values.include?(false)
+  puts "Failed tests: #{results.keys.join(': ')}"
+  exit 1
+end
diff --git a/debian/tests/control b/debian/tests/control
index f6e3f18..c503e18 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,5 @@
 Tests: newapp
 Restrictions: allow-stderr, needs-recommends
+
+Test-Command: gem2deb-test-runner --autopkgtest --check-dependencies 2>&1
+Depends: @, gem2deb-test-runner

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



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