aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2021-01-09 18:52:15 +0100
committerJakub Jirutka <jakub@jirutka.cz>2021-01-09 18:53:18 +0100
commit9ef1d60f87808729ebcb6cbb7160c47245d3a1b8 (patch)
tree0747d957c7ef8a741c228d2bc917c01add2d0bee
parentb42a68300b96fda5259e41383d8a807e9114f9af (diff)
downloadaports-9ef1d60f87808729ebcb6cbb7160c47245d3a1b8.tar.gz
aports-9ef1d60f87808729ebcb6cbb7160c47245d3a1b8.tar.bz2
aports-9ef1d60f87808729ebcb6cbb7160c47245d3a1b8.tar.xz
community/ruby-mustache: fix tests
-rw-r--r--community/ruby-mustache/APKBUILD8
-rw-r--r--community/ruby-mustache/fix-test-race-condition.patch36
2 files changed, 41 insertions, 3 deletions
diff --git a/community/ruby-mustache/APKBUILD b/community/ruby-mustache/APKBUILD
index 2dd64e3572..dfe955cf7e 100644
--- a/community/ruby-mustache/APKBUILD
+++ b/community/ruby-mustache/APKBUILD
@@ -3,16 +3,17 @@
pkgname=ruby-mustache
_gemname=mustache
pkgver=1.1.1
-pkgrel=2
+pkgrel=3
pkgdesc="Logic-less Ruby templates"
url="https://mustache.github.io/"
arch="noarch"
license="MIT"
depends="ruby"
-options="!check" # TODO: check seems to fail on all arches except x86_64
checkdepends="ruby-minitest ruby-rake ruby-rdoc"
source="$pkgname-$pkgver.tar.gz::https://github.com/mustache/mustache/archive/v$pkgver.tar.gz
- skip-simplecov.patch"
+ fix-test-race-condition.patch
+ skip-simplecov.patch
+ "
builddir="$srcdir/$_gemname-$pkgver"
build() {
@@ -42,4 +43,5 @@ package() {
}
sha512sums="3bfe85698ffc95828cb2c6d7ee77049a7dab3a60313289cb0b19e9210d17e4de043df913784c5322a0d9d2073ee6be66f973df9b290e939a0eab153727c31fab ruby-mustache-1.1.1.tar.gz
+bb122077fa486acd9b737dcf961baeae53b766a48bc635ac48b11e675923885c8110b0095a2600f1655adb034938b04c979c1f5a5d7064d040c207f47eb4d2cc fix-test-race-condition.patch
1d457e4f059aabb76f2b84fbebb513a3872715b83508528f06c8de5ea98262a4e266c154fa8cf3f5cae0a9fff6e0b82e0c2278f7979ac27a60b202b825b41e5e skip-simplecov.patch"
diff --git a/community/ruby-mustache/fix-test-race-condition.patch b/community/ruby-mustache/fix-test-race-condition.patch
new file mode 100644
index 0000000000..824825bacb
--- /dev/null
+++ b/community/ruby-mustache/fix-test-race-condition.patch
@@ -0,0 +1,36 @@
+From 407c6a5db6c1f1cfb40bd6113f07f067d07885a4 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
+Date: Mon, 27 Apr 2020 11:16:17 +0200
+Subject: [PATCH] Fix test race condition.
+
+The test suite randomly fails with errors such as:
+
+~~~
+ 1) Failure:
+AutoloadingTest#test_autoload_lowercase [/builddir/build/BUILD/mustache-1.1.1/usr/share/gems/gems/mustache-1.1.1/test/autoloading_test.rb:17]:
+Expected: Comments
+ Actual: nil
+~~~
+
+This happens when `test_namespaced*` test cases are executed earlier
+than the remaining test cases, because they are defining
+`view_namespace` but not cleaning up afterwards.
+---
+ test/autoloading_test.rb | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/test/autoloading_test.rb b/test/autoloading_test.rb
+index 0a7ad762..77eb3557 100644
+--- a/test/autoloading_test.rb
++++ b/test/autoloading_test.rb
+@@ -7,6 +7,10 @@ def setup
+ Mustache.view_path = File.dirname(__FILE__) + '/fixtures'
+ end
+
++ def teardown
++ Mustache.remove_instance_variable(:@view_namespace) if Mustache.instance_variable_defined?(:@view_namespace)
++ end
++
+ def test_autoload
+ klass = Mustache.view_class(:Comments)
+ assert_equal Comments, klass