#510 Re-enable clog tests
Merged 3 years ago by onosek. Opened 3 years ago by onosek.
onosek/rpkg unittest_workaround  into  master

file modified
+5
@@ -2343,7 +2343,12 @@ 

          """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,

file modified
-6
@@ -329,7 +329,6 @@ 

          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 @@ 

          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 @@ 

          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 @@ 

          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 @@ 

          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 @@ 

          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):

rebased onto 056c17c29a54be20e1870bf6e9849f18975e6195

3 years ago

Just found out, that --undefine doesn't work in el6 build.

rebased onto 93a94ef

3 years ago

It seems that el6 is gonna be retired on November this year. So 'rpkg' won't be released for this distro.

Pull-Request has been merged by onosek

3 years ago