From 24453481e1af929dae09f357d1f8253f9a8f318a Mon Sep 17 00:00:00 2001 From: Aditya Bisoi Date: Apr 27 2021 13:59:09 +0000 Subject: Added .rpmlintrc to the list of files ignored by fedpkg import JIRA: RHELCMP-4769 Resolves: rhbz#1946688 Signed-off-by: Aditya Bisoi abisoi@redhat.com --- diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py index a479851..a559fd6 100644 --- a/pyrpkg/__init__.py +++ b/pyrpkg/__init__.py @@ -1799,7 +1799,7 @@ class Commands(object): # while importing a SRPM. # The list also contains files, that are important and should # not be removed by import command. - reserved_ourfiles = ['README.md', 'gating.yaml', 'tests/*'] + reserved_ourfiles = ['README.md', 'gating.yaml', 'tests/*', '*.rpmlintrc'] # Get a list of files we're currently tracking ourfiles = self.repo.git.ls_files().split('\n') diff --git a/tests/test_cli.py b/tests/test_cli.py index 6fde6dd..8421564 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1479,13 +1479,16 @@ class TestImportSrpm(LookasideCacheMock, CliTestCase): self.assert_import_srpm(self.chaos_repo) self.assert_import_srpm(self.cloned_repo_path) - def test_import_gating_exception(self): - # Add two additional files to the repo. Former (gating.yaml) is listed among reserved - # files, latter is not and after import it should be removed from the repo. + def test_import_gating_and_rpmlintrc_exception(self): + # Add three additional files to the repo. Former gating.yaml and package.rpmlintrc are + # listed among reserved files, latter is not and after import it should + # be removed from the repo. cmds = ( ['touch', 'gating.yaml'], + ['touch', 'package.rpmlintrc'], ['touch', 'the_file_is_not_in_reserved.yaml'], ['git', 'add', 'gating.yaml'], + ['git', 'add', 'package.rpmlintrc'], ['git', 'add', 'the_file_is_not_in_reserved.yaml'], ['git', 'commit', '--amend', '--no-edit'], # non-interactive amend ) @@ -1501,6 +1504,7 @@ class TestImportSrpm(LookasideCacheMock, CliTestCase): cli.import_srpm() self.assertFilesExist(['gating.yaml'], search_dir=self.chaos_repo) + self.assertFilesExist(['package.rpmlintrc'], search_dir=self.chaos_repo) self.assertFilesNotExist(['the_file_is_not_in_reserved.yaml'], search_dir=self.chaos_repo)