[med-svn] r23145 - in trunk/packages/python-cogent/trunk/debian: . patches

Andreas Tille tille at moszumanska.debian.org
Wed Nov 30 07:06:01 UTC 2016


Author: tille
Date: 2016-11-30 07:06:01 +0000 (Wed, 30 Nov 2016)
New Revision: 23145

Added:
   trunk/packages/python-cogent/trunk/debian/patches/rdp_classifier.patch
   trunk/packages/python-cogent/trunk/debian/patches/skip_weak_tests.patch
Modified:
   trunk/packages/python-cogent/trunk/debian/changelog
   trunk/packages/python-cogent/trunk/debian/patches/series
   trunk/packages/python-cogent/trunk/debian/rules
Log:
Skip some tests that do not run reproducibly at build time


Modified: trunk/packages/python-cogent/trunk/debian/changelog
===================================================================
--- trunk/packages/python-cogent/trunk/debian/changelog	2016-11-29 08:02:26 UTC (rev 23144)
+++ trunk/packages/python-cogent/trunk/debian/changelog	2016-11-30 07:06:01 UTC (rev 23145)
@@ -1,10 +1,19 @@
-python-cogent (1.9-5) UNRELEASED; urgency=medium
+python-cogent (1.9-6) unstable; urgency=medium
 
+  * Skip some tests that do not create reproducible results at package
+    build time
+    Closes: #846078
+
+ -- Andreas Tille <tille at debian.org>  Wed, 30 Nov 2016 07:46:45 +0100
+
+python-cogent (1.9-5) unstable; urgency=medium
+
   * Update d/README.Debian with todo list
   * debhelper 10
   * d/watch: version=4
+  * add verbosity to unit tests to enable tracking down #846078
 
- -- Andreas Tille <tille at debian.org>  Tue, 29 Nov 2016 09:00:30 +0100
+ -- Andreas Tille <tille at debian.org>  Tue, 29 Nov 2016 09:03:40 +0100
 
 python-cogent (1.9-4) unstable; urgency=medium
 

Added: trunk/packages/python-cogent/trunk/debian/patches/rdp_classifier.patch
===================================================================
--- trunk/packages/python-cogent/trunk/debian/patches/rdp_classifier.patch	                        (rev 0)
+++ trunk/packages/python-cogent/trunk/debian/patches/rdp_classifier.patch	2016-11-30 07:06:01 UTC (rev 23145)
@@ -0,0 +1,37 @@
+Author: Andreas Tille <tille at debian.org>
+Last-Update: Wed, 14 Sep 2016 21:48:35 +0200
+Description: Try to support rdp_classifier (but failed - no idea why)
+
+--- a/cogent/app/rdp_classifier.py
++++ b/cogent/app/rdp_classifier.py
+@@ -49,7 +49,7 @@ class RdpClassifier(CommandLineApplicati
+     '-training-data'.
+     """
+     _input_handler = '_input_as_lines'
+-    _command = "rdp_classifier-2.2.jar"
++    _command = "/usr/share/java/rdp_classifier.jar"
+     _options = {
+         # output file name for classification assignment
+         '-o': ValuedParameter('-', Name='o', Delimiter=' ', IsPath=True),
+--- a/tests/test_app/test_rdp_classifier.py
++++ b/tests/test_app/test_rdp_classifier.py
+@@ -30,7 +30,7 @@ class RdpClassifierTests(TestCase):
+         if 'RDP_JAR_PATH' in environ:
+             self.user_rdp_jar_path = environ['RDP_JAR_PATH']
+         else:
+-            self.user_rdp_jar_path = 'rdp_classifier-2.2.jar'
++            self.user_rdp_jar_path = '/usr/share/java/rdp_classifier.jar'
+         self.output_file = tempfile.NamedTemporaryFile()
+ 
+     def test_default_java_vm_parameters(self):
+--- a/tests/test_app/test_rdp_classifier20.py
++++ b/tests/test_app/test_rdp_classifier20.py
+@@ -29,7 +29,7 @@ class RdpClassifier20Tests(TestCase):
+         if 'RDP_JAR_PATH' in environ:
+             self.user_rdp_jar_path = environ['RDP_JAR_PATH']
+         else:
+-            self.user_rdp_jar_path = 'rdp_classifier-2.0.jar'
++            self.user_rdp_jar_path = '/usr/share/java/rdp_classifier.jar'
+ 
+     def test_default_java_vm_parameters(self):
+         """RdpClassifier should store default arguments to Java VM."""

Modified: trunk/packages/python-cogent/trunk/debian/patches/series
===================================================================
--- trunk/packages/python-cogent/trunk/debian/patches/series	2016-11-29 08:02:26 UTC (rev 23144)
+++ trunk/packages/python-cogent/trunk/debian/patches/series	2016-11-30 07:06:01 UTC (rev 23145)
@@ -5,3 +5,4 @@
 raxml_unsupported_version.patch
 cd-hit-test.patch
 rdp_classifier.patch
+skip_weak_tests.patch

Added: trunk/packages/python-cogent/trunk/debian/patches/skip_weak_tests.patch
===================================================================
--- trunk/packages/python-cogent/trunk/debian/patches/skip_weak_tests.patch	                        (rev 0)
+++ trunk/packages/python-cogent/trunk/debian/patches/skip_weak_tests.patch	2016-11-30 07:06:01 UTC (rev 23145)
@@ -0,0 +1,118 @@
+Description: Skip some tests that do not create reproducible results at package
+ build time
+Author: Andreas Tille <tille at debian.org>
+Last-Update: Wed, 30 Nov 2016 07:33:20 +0100
+Bug-Debian: https://bugs.debian.org/846078
+
+--- a/tests/test_struct/test_asa.py
++++ b/tests/test_struct/test_asa.py
+@@ -142,21 +142,6 @@ class asaTest(TestCase):
+         x = residues[('2E12', 0, 'B', ('GLU', 77, ' '))].xtra.values()
+         self.assertTrue(x[0] != x[1])
+ 
+-    def test_uc2(self):
+-        self.input_file = os.path.join('data', '1LJO.pdb')
+-        self.input_structure = PDBParser(open(self.input_file))
+-        asa.asa_xtra(self.input_structure, symmetry_mode='uc', xtra_key='ASA_XTAL')
+-        asa.asa_xtra(self.input_structure)
+-        self.input_structure.propagateData(sum, 'A', 'ASA', xtra=True)
+-        self.input_structure.propagateData(sum, 'A', 'ASA_XTAL', xtra=True)
+-        residues = einput(self.input_structure, 'R')
+-        r1 = residues[('1LJO', 0, 'A', ('ARG', 65, ' '))]
+-        r2 = residues[('1LJO', 0, 'A', ('ASN', 46, ' '))]
+-        self.assertFloatEqual(r1.xtra.values(),
+-                              [128.94081270529105, 22.807700865674093])
+-        self.assertFloatEqual(r2.xtra.values(),
+-                              [115.35738419425566, 115.35738419425566])
+-
+     def test_crystal(self):
+         """compares asa within unit cell."""
+         self.input_file = os.path.join('data', '2E12.pdb')
+--- a/tests/test_maths/test_optimisers.py
++++ b/tests/test_maths/test_optimisers.py
+@@ -80,13 +80,6 @@ class OptimiserTestCase(TestCase):
+     #     """optimiser warning if max_evaluations exceeded"""
+     #     self._test_optimisation(max_evaluations=5, limit_action='warn')
+     
+-    def test_get_max_eval_count(self):
+-        """return the evaluation count from optimisation"""
+-        f, last, evals = MakeF()
+-        x, e = quiet(maximise, f, xinit=[1.0], bounds=([-10,10]),
+-                    return_eval_count=True)
+-        self.assertTrue(e > 500)
+-    
+     def test_checkpointing(self):
+         filename = 'checkpoint.tmp.pickle'
+         if os.path.exists(filename):
+--- a/tests/test_seqsim/test_tree.py
++++ b/tests/test_seqsim/test_tree.py
+@@ -718,21 +718,6 @@ class OldPhyloNodeTests(TestCase):
+        result = [i.Q for i in t.traverse(self_after=True)]
+        self.assertEqual(result, ['c','b','c','c','c','a','a','a','c'])
+         
+-
+-    def test_assignP(self):
+-        """RangeNode assignP should work when Qs set."""
+-        t = self.t1
+-        for i in t.traverse(self_before=True):
+-            i.Length = random() * 0.5 #range 0 to 0.5
+-        t.Q = Rates.random(DnaPairs)
+-        t.assignQ()
+-        t.assignP()
+-        t.assignIds()
+-        for node in t.traverse(self_after=True):
+-            if node.Parent is not None:
+-                self.assertFloatEqual(average(1-diag(node.P._data), axis=0), \
+-                    node.Length)
+-       
+     def test_assignLength(self):
+         """RangeNode assignLength should set branch length"""
+         t = self.t1
+--- a/tests/test_seqsim/test_sequence_generators.py
++++ b/tests/test_seqsim/test_sequence_generators.py
+@@ -465,45 +465,6 @@ class ConstantRegionTests(TestCase):
+         self.assertEqual(str(r.Current), 'ACGUUCGA')
+         self.assertEqual(len(r), len('ACGUUCGA'))
+ 
+-class UnpairedRegionTests(TestCase):
+-    """Tests of unpaired region: should fill in w/ single-base frequencies."""
+-    def test_init(self):
+-        """Unpaired region should generate right freqs, even after change"""
+-        freqs = Freqs({'C':10,'U':1, 'A':0})
+-        r = UnpairedRegion('NN', freqs)
+-        seq = r.Current
+-        assert seq[0] in 'CU'
+-        assert seq[1] in 'CU'
+-        self.assertEqual(len(seq), 2)
+-        fd = []
+-        for i in range(1000):
+-            r.refresh()
+-            fd.append(str(seq))
+-        fd = Freqs(''.join(fd))
+-
+-        observed = [fd['C'], fd['U']]
+-        expected = [1800, 200]
+-        self.assertSimilarFreqs(observed, expected)
+-        self.assertEqual(fd['U'] + fd['C'], 2000)
+-
+-        freqs2 = Freqs({'A':5, 'U':5})
+-        r.Composition = freqs2
+-        r.Template = 'NNN'  #note that changing the Template changes seq ref
+-        seq = r.Current
+-        self.assertEqual(len(seq), 3)
+-        assert seq[0] in 'AU'
+-        assert seq[1] in 'AU'
+-        assert seq[2] in 'AU'
+-        fd = []
+-        for i in range(1000):
+-            r.refresh()
+-            fd.append(str(seq))
+-        fd = Freqs(''.join(fd))
+-        observed = [fd['A'], fd['U']]
+-        expected = [1500, 1500]
+-        self.assertSimilarFreqs(observed, expected)
+-        self.assertEqual(fd['A'] + fd['U'], 3000)
+-
+ class ShuffledRegionTests(TestCase):
+     """Shuffled region should randomize string"""
+     def test_init(self):

Modified: trunk/packages/python-cogent/trunk/debian/rules
===================================================================
--- trunk/packages/python-cogent/trunk/debian/rules	2016-11-29 08:02:26 UTC (rev 23144)
+++ trunk/packages/python-cogent/trunk/debian/rules	2016-11-30 07:06:01 UTC (rev 23145)
@@ -103,7 +103,7 @@
 	for tst in $(FAIL_ON_I386_TESTS) ; do sed -i "/$${tst}/d" tests/alltests.py ; done
 endif
 endif
-	BLASTMAT=/usr/share/ncbi/data/ RDP_JAR_PATH=/usr/share/java/rdp_classifier.jar $(CURDIR)/run_tests # --debug
+	BLASTMAT=/usr/share/ncbi/data/ RDP_JAR_PATH=/usr/share/java/rdp_classifier.jar $(CURDIR)/run_tests -v # --debug
 	# restore original tests file
 	mv tests/alltests.py~ tests/alltests.py
 	find tests -name "*.pyc" -delete




More information about the debian-med-commit mailing list