Don't validate .placeholder
When creating a new election we need to add a directory per project (including the 'TC' as a pseudo project) we can't just create an empty directory in git so we add a '.placeholder' file. We have recently added a voting job that will run try to validate all candidate files added in a review. This includes the placeholder file. CLearly this file will not pass validation and cause the job to fail. Adding .placeholder to the zuul irrelevant-files variable wont work, so instead filter .placeholder from the interesting files. Change-Id: Ibd2224a5479d4ab9afbac227bac38080359a98bf
This commit is contained in:
parent
77c4fe302e
commit
3bf36b7128
@ -84,7 +84,8 @@ def find_modified_candidate_files():
|
|||||||
filenames = [
|
filenames = [
|
||||||
l.strip()
|
l.strip()
|
||||||
for l in results.splitlines()
|
for l in results.splitlines()
|
||||||
if l.startswith(utils.CANDIDATE_PATH + '/')
|
if (l.startswith(utils.CANDIDATE_PATH + '/') and
|
||||||
|
not l.endswith('.placeholder'))
|
||||||
]
|
]
|
||||||
return filenames
|
return filenames
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ class TestFindModifiedCandidateFiles(base.ElectionTestCase):
|
|||||||
check_output = (('configuration.yaml\n'
|
check_output = (('configuration.yaml\n'
|
||||||
'%(path)s/.placeholder\n'
|
'%(path)s/.placeholder\n'
|
||||||
) % ({'path': utils.CANDIDATE_PATH})).encode('utf-8')
|
) % ({'path': utils.CANDIDATE_PATH})).encode('utf-8')
|
||||||
expected_filenames = ['%s/.placeholder' % utils.CANDIDATE_PATH]
|
expected_filenames = []
|
||||||
mock_check_output.return_value = check_output
|
mock_check_output.return_value = check_output
|
||||||
filenames = \
|
filenames = \
|
||||||
ci_check_all_candidate_files.find_modified_candidate_files()
|
ci_check_all_candidate_files.find_modified_candidate_files()
|
||||||
@ -48,9 +48,7 @@ class TestFindModifiedCandidateFiles(base.ElectionTestCase):
|
|||||||
'%(path)s/cadidate\n'
|
'%(path)s/cadidate\n'
|
||||||
'%(path)s/.placeholder\n'
|
'%(path)s/.placeholder\n'
|
||||||
) % ({'path': utils.CANDIDATE_PATH})).encode('utf-8')
|
) % ({'path': utils.CANDIDATE_PATH})).encode('utf-8')
|
||||||
expected_filenames = ['%s/cadidate' % utils.CANDIDATE_PATH,
|
expected_filenames = ['%s/cadidate' % utils.CANDIDATE_PATH]
|
||||||
'%s/.placeholder' % utils.CANDIDATE_PATH
|
|
||||||
]
|
|
||||||
mock_check_output.return_value = check_output
|
mock_check_output.return_value = check_output
|
||||||
filenames = \
|
filenames = \
|
||||||
ci_check_all_candidate_files.find_modified_candidate_files()
|
ci_check_all_candidate_files.find_modified_candidate_files()
|
||||||
|
Loading…
Reference in New Issue
Block a user