Make diffs in dup_consistency files part of scheme

Previously, changing a duplicate_consistency file would be
considered a 'global' change, resulting in CI re-running all tests
for all schemes.
This commit is contained in:
Joost Rijneveld 2019-04-23 12:14:53 +02:00
parent 28358b579d
commit fa7d257832
No known key found for this signature in database
GPG Key ID: A4FE39CF49CBC553

View File

@ -173,13 +173,17 @@ def permit_test(testname, thing, *args, **kwargs):
for diff_line in diff_result.stdout.decode('utf-8').splitlines(): for diff_line in diff_result.stdout.decode('utf-8').splitlines():
# don't skip test if there are any changes outside schemes # don't skip test if there are any changes outside schemes
if (not diff_line.startswith('crypto_kem') and if (not diff_line.startswith('crypto_kem') and
not diff_line.startswith('crypto_sign')): not diff_line.startswith('crypto_sign') and
not diff_line.startswith(os.path.join('test', 'duplicate_consistency'))):
logging.info("Running all tests as there are changes " logging.info("Running all tests as there are changes "
"outside of schemes") "outside of schemes")
return True return True
# do test if the scheme in question has been changed # do test if the scheme in question has been changed
if diff_line.startswith(thing.path(base='')): if diff_line.startswith(thing.path(base='')):
return True return True
# do test if the scheme's duplicate_consistency files have been changed
if diff_line.startswith(os.path.join('test', 'duplicate_consistency', scheme.name.lower())):
return True
# there were no changes outside schemes, and the scheme in question had no diffs # there were no changes outside schemes, and the scheme in question had no diffs
return False return False