[DRE-commits] [ruby-protected-attributes] 01/01: Import Debian patch 1.1.3-2
Antonio Terceiro
terceiro at moszumanska.debian.org
Thu Dec 8 11:50:58 UTC 2016
This is an automated email from the git hooks/post-receive script.
terceiro pushed a commit to branch master
in repository ruby-protected-attributes.
commit e97d1d26ceff2240b6a676ae9a4bfcf6321dc874
Author: Antonio Terceiro <terceiro at debian.org>
Date: Thu Sep 1 11:38:39 2016 -0300
Import Debian patch 1.1.3-2
---
debian/changelog | 7 +++++++
debian/control | 8 ++++----
debian/patches/fix-ramdom-failures.patch | 33 ++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
4 files changed, 45 insertions(+), 4 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index ab8e87e..fdf81e5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+ruby-protected-attributes (1.1.3-2) unstable; urgency=medium
+
+ * Apply patch (already submitted upstream) to fix random failures when
+ running tests during the build (Closes: #834963)
+
+ -- Antonio Terceiro <terceiro at debian.org> Thu, 01 Sep 2016 11:38:39 -0300
+
ruby-protected-attributes (1.1.3-1) unstable; urgency=medium
* debian/watch: point at github since tests are not distributed to
diff --git a/debian/control b/debian/control
index 4aa78b4..cea042c 100644
--- a/debian/control
+++ b/debian/control
@@ -6,15 +6,15 @@ Uploaders: Antonio Terceiro <terceiro at debian.org>
Build-Depends: bundler,
debhelper (>= 9~),
gem2deb,
+ rake,
rails (<< 2:5.0),
rails (>= 2:4.0.1),
- rake,
ruby-activemodel (<< 2:5.0),
ruby-activemodel (>= 2:4.0.1),
ruby-mocha,
- ruby-sqlite3
-Standards-Version: 3.9.7
-Vcs-Git: https://anonscm.debian.org/git/pkg-ruby-extras/ruby-protected-attributes.git
+ ruby-sqlite3,
+Standards-Version: 3.9.6
+Vcs-Git: git://anonscm.debian.org/pkg-ruby-extras/ruby-protected-attributes.git
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-ruby-extras/ruby-protected-attributes.git
Homepage: https://github.com/rails/protected_attributes
Testsuite: autopkgtest-pkg-ruby
diff --git a/debian/patches/fix-ramdom-failures.patch b/debian/patches/fix-ramdom-failures.patch
new file mode 100644
index 0000000..98091c2
--- /dev/null
+++ b/debian/patches/fix-ramdom-failures.patch
@@ -0,0 +1,33 @@
+From b12b823687f3549dbea699df7c109f1d54075754 Mon Sep 17 00:00:00 2001
+From: Antonio Terceiro <terceiro at debian.org>
+Date: Mon, 29 Aug 2016 15:26:19 -0300
+Subject: [PATCH] attribute_sanitization_test: avoid random failures
+
+Because test/test_helper.rb sets the tests to run on random order, that
+missing call to `super` will cause tests to crash with the following
+exception, depending on which order the test classes get loaded.
+
+```
+ActiveRecord::RecordNotUnique: SQLite3::ConstraintException: UNIQUE
+constraint failed: people.id: INSERT INTO "people" ("id", "first_name", "gender", "comments", "best_friend_id", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?)
+```
+
+On my tests, this seems to happen more or less 6% of the time (i.e. 3
+out of 50 runs). With this change, I was able to make 50 runs without a
+single failure.
+---
+ test/attribute_sanitization_test.rb | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/test/attribute_sanitization_test.rb b/test/attribute_sanitization_test.rb
+index da8fb03..e1d6123 100644
+--- a/test/attribute_sanitization_test.rb
++++ b/test/attribute_sanitization_test.rb
+@@ -16,6 +16,7 @@
+
+ module MassAssignmentTestHelpers
+ def teardown
++ super
+ ActiveRecord::Base.send(:descendants).each do |klass|
+ begin
+ klass.delete_all
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..1e5f4b8
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+fix-ramdom-failures.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-protected-attributes.git
More information about the Pkg-ruby-extras-commits
mailing list