diff -Nru python-smoke-zephyr-1.4.0/debian/changelog python-smoke-zephyr-1.4.1/debian/changelog --- python-smoke-zephyr-1.4.0/debian/changelog 2018-12-05 22:00:06.000000000 +0000 +++ python-smoke-zephyr-1.4.1/debian/changelog 2019-04-01 23:46:12.000000000 +0100 @@ -1,3 +1,17 @@ +python-smoke-zephyr (1.4.1-1) unstable; urgency=medium + + * New upstream version 1.4.1 + * d/p/remove_tests_fix_ftbfs: remove patch, upstream fixed the problem + + -- Samuel Henrique Mon, 01 Apr 2019 23:46:12 +0100 + +python-smoke-zephyr (1.4.0-2) unstable; urgency=medium + + * d/p/remove_tests_fix_ftbfs: disable tests that have always been + problematic (closes: #925208) + + -- Samuel Henrique Thu, 28 Mar 2019 21:27:46 +0000 + python-smoke-zephyr (1.4.0-1) unstable; urgency=medium * New upstream version 1.4.0 diff -Nru python-smoke-zephyr-1.4.0/debian/patches/remove_tests_fix_ftbfs.patch python-smoke-zephyr-1.4.1/debian/patches/remove_tests_fix_ftbfs.patch --- python-smoke-zephyr-1.4.0/debian/patches/remove_tests_fix_ftbfs.patch 2018-12-05 22:00:06.000000000 +0000 +++ python-smoke-zephyr-1.4.1/debian/patches/remove_tests_fix_ftbfs.patch 1970-01-01 01:00:00.000000000 +0100 @@ -1,392 +0,0 @@ -Index: python-smoke-zephyr/tests/argparse_types.py -=================================================================== ---- python-smoke-zephyr.orig/tests/argparse_types.py -+++ /dev/null -@@ -1,85 +0,0 @@ --#!/usr/bin/env python --# -*- coding: utf-8 -*- --# --# tests/argparse_types.py --# --# Redistribution and use in source and binary forms, with or without --# modification, are permitted provided that the following conditions are --# met: --# --# * Redistributions of source code must retain the above copyright --# notice, this list of conditions and the following disclaimer. --# * Redistributions in binary form must reproduce the above --# copyright notice, this list of conditions and the following disclaimer --# in the documentation and/or other materials provided with the --# distribution. --# * Neither the name of the project nor the names of its --# contributors may be used to endorse or promote products derived from --# this software without specific prior written permission. --# --# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --# -- --import argparse --import logging --import os --import unittest -- --from smoke_zephyr import argparse_types --from smoke_zephyr import utilities -- --class ArgparseTypeTests(utilities.TestCase): -- def _invalid_argparse_type(self, function, invalid): -- with self.assertRaises(argparse.ArgumentTypeError): -- function(invalid) -- -- def _valid_argparse_type(self, function, valid, valid_result=None, valid_result_type=None): -- valid_result = valid if valid_result == None else valid_result -- valid_result_type = valid_result_type or str -- result = function(valid) -- self.assertEqual(result, valid_result) -- self.assertIsInstance(result, valid_result_type) -- -- def test_bin_b64_type(self): -- self._invalid_argparse_type(argparse_types.bin_b64_type, '0') -- self._valid_argparse_type(argparse_types.bin_b64_type, 'SGVsbG8gV29ybGQh', b'Hello World!', bytes) -- -- def test_bin_hex_type(self): -- self._invalid_argparse_type(argparse_types.bin_hex_type, 'FAKE') -- self._valid_argparse_type(argparse_types.bin_hex_type, '48656c6c6f20576f726c6421', b'Hello World!', bytes) -- -- def test_dir_type(self): -- self._invalid_argparse_type(argparse_types.dir_type, 'FAKE') -- self._valid_argparse_type(argparse_types.dir_type, os.getcwd(), os.getcwd()) -- self._valid_argparse_type(argparse_types.dir_type, '.', '.') -- -- def test_log_level_type(self): -- self._invalid_argparse_type(argparse_types.log_level_type, 'FAKE') -- for level_name in ('NOTSET', 'DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'): -- self._valid_argparse_type(argparse_types.log_level_type, level_name, getattr(logging, level_name), int) -- -- def test_port_type(self): -- self._invalid_argparse_type(argparse_types.port_type, 'FAKE') -- self._invalid_argparse_type(argparse_types.port_type, '65536') -- self._valid_argparse_type(argparse_types.port_type, '80', 80, int) -- -- def test_timespan_type(self): -- self._invalid_argparse_type(argparse_types.timespan_type, 'FAKE') -- self._invalid_argparse_type(argparse_types.timespan_type, '30x') -- self._valid_argparse_type(argparse_types.timespan_type, '80', 80, int) -- self._valid_argparse_type(argparse_types.timespan_type, '1m', 60, int) -- self._valid_argparse_type(argparse_types.timespan_type, '1h', 3600, int) -- self._valid_argparse_type(argparse_types.timespan_type, '1h1m', 3660, int) -- --if __name__ == '__main__': -- unittest.main() -Index: python-smoke-zephyr/tests/job.py -=================================================================== ---- python-smoke-zephyr.orig/tests/job.py -+++ /dev/null -@@ -1,112 +0,0 @@ --#!/usr/bin/env python --# -*- coding: utf-8 -*- --# --# tests/job.py --# --# Redistribution and use in source and binary forms, with or without --# modification, are permitted provided that the following conditions are --# met: --# --# * Redistributions of source code must retain the above copyright --# notice, this list of conditions and the following disclaimer. --# * Redistributions in binary form must reproduce the above --# copyright notice, this list of conditions and the following disclaimer --# in the documentation and/or other materials provided with the --# distribution. --# * Neither the name of the project nor the names of its --# contributors may be used to endorse or promote products derived from --# this software without specific prior written permission. --# --# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --# -- --import contextlib --import time --import unittest --import uuid -- --from smoke_zephyr import job --from smoke_zephyr import utilities -- --ROUTINE_SLEEP_TIME = 1.5 --def test_routine(): -- time.sleep(ROUTINE_SLEEP_TIME) -- --def test_routine_delete(): -- return job.JobRequestDelete() -- --class JobManagerTests(utilities.TestCase): -- def setUp(self): -- self.assertGreater(ROUTINE_SLEEP_TIME, 1) -- self.jm = job.JobManager() -- self.jm.start() -- -- def tearDown(self): -- self.jm.stop() -- -- @contextlib.contextmanager -- def _job_add(self, callback, parameters=None, expiration=1, wait=True): -- jid = self.jm.job_add(callback, parameters, seconds=1, expiration=expiration) -- self.assertIsInstance(jid, uuid.UUID) -- self.assertTrue(self.jm.job_exists(jid)) -- self.assertEqual(self.jm.job_count(), 1) -- self.assertEqual(self.jm.job_count_enabled(), 1) -- yield jid -- if wait: -- time.sleep(ROUTINE_SLEEP_TIME * 2) -- -- def test_job_init(self): -- self.assertEqual(self.jm.job_count(), 0) -- self.assertEqual(self.jm.job_count_enabled(), 0) -- -- def test_job_add(self): -- test_list = [] -- data = utilities.random_string_alphanumeric(10) -- with self._job_add(test_list.append, data) as jid: -- self.assertEqual(len(test_list), 0) -- self.assertEqual(len(test_list), 1) -- self.assertIn(data, test_list) -- self.assertFalse(self.jm.job_exists(jid)) -- -- def test_job_delete(self): -- with self._job_add(test_routine, wait=False) as jid: -- self.jm.job_delete(jid) -- self.assertEqual(self.jm.job_count(), 0) -- self.assertEqual(self.jm.job_count_enabled(), 0) -- -- def test_job_disable(self): -- with self._job_add(test_routine, wait=False) as jid: -- self.jm.job_disable(jid) -- self.assertEqual(self.jm.job_count(), 1) -- self.assertEqual(self.jm.job_count_enabled(), 0) -- -- def test_job_request_delete(self): -- with self._job_add(test_routine_delete) as jid: -- self.assertTrue(self.jm.job_exists(jid)) -- result = self.jm.job_exists(jid) -- self.assertFalse(result) -- self.assertEqual(self.jm.job_count(), 0) -- self.assertEqual(self.jm.job_count_enabled(), 0) -- -- def test_job_run(self): -- jid = self.jm.job_run(test_routine) -- self.assertIsInstance(jid, uuid.UUID) -- self.assertTrue(self.jm.job_is_running(jid)) -- self.assertEqual(self.jm.job_count(), 1) -- self.assertEqual(self.jm.job_count_enabled(), 1) -- time.sleep(ROUTINE_SLEEP_TIME * 2) -- -- self.assertFalse(self.jm.job_is_running(jid)) -- --if __name__ == '__main__': -- unittest.main() -Index: python-smoke-zephyr/tests/utilities.py -=================================================================== ---- python-smoke-zephyr.orig/tests/utilities.py -+++ /dev/null -@@ -1,180 +0,0 @@ --#!/usr/bin/env python --# -*- coding: utf-8 -*- --# --# tests/utilities.py --# --# Redistribution and use in source and binary forms, with or without --# modification, are permitted provided that the following conditions are --# met: --# --# * Redistributions of source code must retain the above copyright --# notice, this list of conditions and the following disclaimer. --# * Redistributions in binary form must reproduce the above --# copyright notice, this list of conditions and the following disclaimer --# in the documentation and/or other materials provided with the --# distribution. --# * Neither the name of the project nor the names of its --# contributors may be used to endorse or promote products derived from --# this software without specific prior written permission. --# --# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --# -- --import collections --import unittest -- --from smoke_zephyr import utilities -- --SINGLE_QUOTE_STRING_ESCAPED = """C:\\\\Users\\\\Alice\\\\Desktop\\\\Alice\\'s Secret File.txt""" --SINGLE_QUOTE_STRING_UNESCAPED = """C:\\Users\\Alice\\Desktop\\Alice's Secret File.txt""" -- --def cache_test(first_name, last_name, email=None, dob=None): -- return utilities.random_string_alphanumeric(24) -- --class UtilitiesCacheTests(utilities.TestCase): -- def test_cache(self): -- target_function = utilities.Cache('6h')(cache_test) -- -- result_alice = target_function('alice', 'liddle') -- self.assertEqual(target_function('alice', 'liddle'), result_alice) -- -- result_calie = target_function('calie', 'liddle') -- self.assertEqual(target_function('calie', 'liddle'), result_calie) -- self.assertNotEqual(result_alice, result_calie) -- -- result_alice = target_function('alice', 'liddle', email='aliddle@wonderland.com') -- self.assertEqual(target_function('alice', 'liddle', email='aliddle@wonderland.com'), result_alice) -- self.assertNotEqual(result_alice, result_calie) -- -- def test_cache_cache_clear(self): -- target_function = utilities.Cache('6h')(cache_test) -- result_alice = target_function('alice', 'liddle') -- target_function.cache_clear() -- self.assertNotEqual(target_function('alice', 'liddle'), result_alice) -- -- def test_cache_flatten_args(self): -- target_function = utilities.Cache('6h')(cache_test) -- flatten_args = target_function._flatten_args # pylint: disable=W0212 -- self.assertEqual( -- flatten_args(('alice',), {'last_name': 'liddle'}), -- collections.deque(('alice', 'liddle', None, None)) -- ) -- self.assertEqual( -- flatten_args(('alice',), {'last_name': 'liddle', 'email': 'aliddle@wonderland.com'}), -- collections.deque(('alice', 'liddle', 'aliddle@wonderland.com', None)) -- ) -- self.assertEqual( -- flatten_args(('alice', 'liddle'), {}), -- collections.deque(('alice', 'liddle', None, None)) -- ) -- self.assertEqual( -- flatten_args(('alice', 'liddle'), {}), -- collections.deque(('alice', 'liddle', None, None)) -- ) -- self.assertEqual( -- flatten_args(('alice', 'liddle', 'aliddle@wonderland.com'), {}), -- collections.deque(('alice', 'liddle', 'aliddle@wonderland.com', None)) -- ) -- self.assertEqual( -- flatten_args(('alice', 'liddle'), {'dob': '1990'}), -- collections.deque(('alice', 'liddle', None, '1990')) -- ) -- -- with self.assertRaisesRegex(TypeError, r'^cache_test\(\) missing required argument \'last_name\'$'): -- flatten_args(('alice',), {}) -- with self.assertRaisesRegex(TypeError, r'^cache_test\(\) got an unexpected keyword argument \'foobar\'$'): -- flatten_args(('alice', 'liddle'), {'foobar': True}) -- --class UtilitiesTests(utilities.TestCase): -- def test_attribute_dict(self): -- ad = utilities.AttributeDict(test=1) -- self.assertIsInstance(ad, utilities.AttributeDict) -- self.assertEqual(ad['test'], ad.test) -- self.assertEqual(ad.test, 1) -- -- def test_escape_single_quote(self): -- escaped_string = utilities.escape_single_quote(SINGLE_QUOTE_STRING_UNESCAPED) -- self.assertEqual(escaped_string, SINGLE_QUOTE_STRING_ESCAPED) -- -- def test_is_valid_email_address(self): -- valid_emails = [ -- 'aliddle@wonderland.com', -- 'aliddle@wonderland.co.uk', -- 'alice.liddle1+spam@wonderland.com', -- ] -- invalid_emails = [ -- 'aliddle.wonderland.com' -- 'aliddle+', -- 'aliddle@', -- 'aliddle', -- '', -- '@wonderland.com', -- '@wonder@land.com', -- 'aliddle@.com' -- ] -- for address in valid_emails: -- self.assertTrue(utilities.is_valid_email_address(address)) -- for address in invalid_emails: -- self.assertFalse(utilities.is_valid_email_address(address)) -- -- def test_parse_case_camel_to_snake(self): -- parsed = utilities.parse_case_camel_to_snake('SmokeZephyr') -- self.assertEqual(parsed, 'smoke_zephyr') -- -- def test_parse_case_snake_to_camel(self): -- parsed = utilities.parse_case_snake_to_camel('smoke_zephyr') -- self.assertEqual(parsed, 'SmokeZephyr') -- parsed = utilities.parse_case_snake_to_camel('smoke_zephyr', False) -- self.assertEqual(parsed, 'smokeZephyr') -- -- def test_parse_server(self): -- parsed = utilities.parse_server('127.0.0.1', 80) -- self.assertIsInstance(parsed, tuple) -- self.assertEqual(len(parsed), 2) -- self.assertEqual(parsed[0], '127.0.0.1') -- self.assertEqual(parsed[1], 80) -- parsed = utilities.parse_server('127.0.0.1:8080', 80) -- self.assertIsInstance(parsed, tuple) -- self.assertEqual(len(parsed), 2) -- self.assertEqual(parsed[0], '127.0.0.1') -- self.assertEqual(parsed[1], 8080) -- parsed = utilities.parse_server('[::1]:8080', 80) -- self.assertIsInstance(parsed, tuple) -- self.assertEqual(len(parsed), 2) -- self.assertEqual(parsed[0], '::1') -- self.assertEqual(parsed[1], 8080) -- -- def test_parse_timespan(self): -- self.assertRaises(ValueError, utilities.parse_timespan, 'fake') -- self.assertEqual(utilities.parse_timespan(''), 0) -- self.assertEqual(utilities.parse_timespan('30'), 30) -- self.assertEqual(utilities.parse_timespan('1m30s'), 90) -- self.assertEqual(utilities.parse_timespan('2h1m30s'), 7290) -- self.assertEqual(utilities.parse_timespan('3d2h1m30s'), 266490) -- -- def test_parse_to_slug(self): -- parsed = utilities.parse_to_slug('Smoke Zephyr!') -- self.assertEqual(parsed, 'smoke-zephyr') -- parsed = utilities.parse_to_slug('_Smoke Zephyr! (Next Try)') -- self.assertEqual(parsed, 'smoke-zephyr-next-try') -- -- def test_selection_collision(self): -- chance = utilities.selection_collision(30, 365) -- self.assertAlmostEqual(chance, 70.6316243) -- -- def test_unescape_single_quote(self): -- unescaped_string = utilities.unescape_single_quote(SINGLE_QUOTE_STRING_ESCAPED) -- self.assertEqual(unescaped_string, SINGLE_QUOTE_STRING_UNESCAPED) -- --if __name__ == '__main__': -- unittest.main() diff -Nru python-smoke-zephyr-1.4.0/debian/patches/series python-smoke-zephyr-1.4.1/debian/patches/series --- python-smoke-zephyr-1.4.0/debian/patches/series 2018-12-05 22:00:06.000000000 +0000 +++ python-smoke-zephyr-1.4.1/debian/patches/series 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -remove_tests_fix_ftbfs.patch diff -Nru python-smoke-zephyr-1.4.0/.gitignore python-smoke-zephyr-1.4.1/.gitignore --- python-smoke-zephyr-1.4.0/.gitignore 2018-11-21 17:29:33.000000000 +0000 +++ python-smoke-zephyr-1.4.1/.gitignore 2019-03-30 23:03:31.000000000 +0000 @@ -11,3 +11,5 @@ docs/html smoke_zephyr.egg-info/* MANIFEST +Pipfile +Pipfile.lock diff -Nru python-smoke-zephyr-1.4.0/setup.py python-smoke-zephyr-1.4.1/setup.py --- python-smoke-zephyr-1.4.0/setup.py 2018-11-21 17:29:33.000000000 +0000 +++ python-smoke-zephyr-1.4.1/setup.py 2019-03-30 23:03:31.000000000 +0000 @@ -56,7 +56,7 @@ setup( name='smoke-zephyr', - version='1.4.0', + version='1.4.1', author='Spencer McIntyre', author_email='zeroSteiner@gmail.com', maintainer='Spencer McIntyre', diff -Nru python-smoke-zephyr-1.4.0/smoke_zephyr/__init__.py python-smoke-zephyr-1.4.1/smoke_zephyr/__init__.py --- python-smoke-zephyr-1.4.0/smoke_zephyr/__init__.py 2018-11-21 17:29:33.000000000 +0000 +++ python-smoke-zephyr-1.4.1/smoke_zephyr/__init__.py 2019-03-30 23:03:31.000000000 +0000 @@ -33,7 +33,7 @@ import collections # Semantic Versioning: http://semver.org/spec/v2.0.0.html -version_info = collections.namedtuple('version_info', ['major', 'minor', 'micro'])(1, 4, 0) +version_info = collections.namedtuple('version_info', ['major', 'minor', 'micro'])(1, 4, 1) """A tuple representing the version information in the format ('major', 'minor', 'micro')""" version_label = '' diff -Nru python-smoke-zephyr-1.4.0/smoke_zephyr/job.py python-smoke-zephyr-1.4.1/smoke_zephyr/job.py --- python-smoke-zephyr-1.4.0/smoke_zephyr/job.py 2018-11-21 17:29:33.000000000 +0000 +++ python-smoke-zephyr-1.4.1/smoke_zephyr/job.py 2019-03-30 23:03:31.000000000 +0000 @@ -139,7 +139,7 @@ job_obj = job_desc['job'] if job_obj.is_alive() or job_obj.reaped: continue - if job_obj.exception != None: + if job_obj.exception is not None: if job_desc['tolerate_exceptions']: self.logger.warning('job ' + str(job_id) + ' encountered exception: ' + job_obj.exception.__class__.__name__, exc_info=self.exc_info) else: @@ -161,7 +161,7 @@ # sow jobs for job_id, job_desc in self._jobs.items(): - if job_desc['last_run'] != None and self.now_is_before(job_desc['last_run'] + job_desc['run_every']): + if job_desc['last_run'] is not None and self.now_is_before(job_desc['last_run'] + job_desc['run_every']): continue if job_desc['job'].is_alive(): continue @@ -231,8 +231,12 @@ if not job_desc['job'].is_alive(): continue job_desc['job'].join() - self._thread.join() + + # the job lock must be released before the thread can be joined because the thread routine acquires it before + # checking if it should exit, see https://github.com/zeroSteiner/smoke-zephyr/issues/4 for more details self._job_lock.release() + self._thread.join() + self.logger.info('the job manager has been stopped') return