From 93a94ef7f7a8a15e9e1e0f02dd600bc148fe19ae Mon Sep 17 00:00:00 2001 From: Ondřej Nosek Date: Aug 25 2020 12:50:28 +0000 Subject: Re-enable clog tests Applied workaround described here: https://github.com/rpm-software-management/rpm/issues/1301 Signed-off-by: Ondřej Nosek --- diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py index 3c03d15..a4dc6d9 100644 --- a/pyrpkg/__init__.py +++ b/pyrpkg/__init__.py @@ -2343,7 +2343,12 @@ class Commands(object): """Write the latest spec changelog entry to a clog file""" spec_file = os.path.join(self.path, self.spec) + # TODO: remove when fixed + # Command contains workaround (undefines _changelog_trimtime) described at: + # https://github.com/rpm-software-management/rpm/issues/1301 + # It caused, that older changelog records were not displayed. cmd = ['rpm'] + self.rpmdefines + ['-q', '--qf', '"%{CHANGELOGTEXT}\n"', + '--undefine', '"_changelog_trimtime"', '--specfile', '"%s"' % spec_file] proc = subprocess.Popen(' '.join(cmd), shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, diff --git a/tests/test_cli.py b/tests/test_cli.py index eb9c79e..3185e90 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -329,7 +329,6 @@ class TestClog(CliTestCase): cli = self.new_cli() cli.clog() - @unittest.skip("temporarily disabled") def test_clog(self): cli_cmd = ['rpkg', '--path', self.cloned_repo_path, 'clog'] @@ -341,7 +340,6 @@ class TestClog(CliTestCase): clog = self.read_file(clog_file).strip() self.assertEqual('Initial version', clog) - @unittest.skip("temporarily disabled") def test_raw_clog(self): cli_cmd = ['rpkg', '--path', self.cloned_repo_path, 'clog', '--raw'] @@ -353,7 +351,6 @@ class TestClog(CliTestCase): clog = self.read_file(clog_file).strip() self.assertEqual('- Initial version', clog) - @unittest.skip("temporarily disabled") def test_reference_source_files_in_spec_should_not_break_clog(self): """SPEC containing Source0 or Patch0 should not break clog @@ -390,7 +387,6 @@ class TestCommit(CliTestCase): commit_msg = self.get_last_commit_message() self.assertEqual('new release', commit_msg) - @unittest.skip("temporarily disabled") def test_with_summary_and_changelog(self): cli_cmd = ['rpkg', '--path', self.cloned_repo_path, 'commit', '-m', 'new release', '--with-changelog'] @@ -406,7 +402,6 @@ class TestCommit(CliTestCase): self.assertFalse(os.path.exists(os.path.join(self.cloned_repo_path, 'clog'))) self.assertFalse(os.path.exists(os.path.join(self.cloned_repo_path, 'commit-message'))) - @unittest.skip("temporarily disabled") def test_with_clog(self): cli_cmd = ['rpkg', '--path', self.cloned_repo_path, 'commit', '--clog'] @@ -418,7 +413,6 @@ class TestCommit(CliTestCase): self.assertEqual(expected_commit_msg, commit_msg) self.assertFalse(os.path.exists(os.path.join(self.cloned_repo_path, 'clog'))) - @unittest.skip("temporarily disabled") def test_with_raw_clog(self): cli_cmd = ['rpkg', '--path', self.cloned_repo_path, 'commit', '--clog', '--raw'] with patch('sys.argv', new=cli_cmd):