Ver código fonte

another attempt at fixing appveyor

tags/v0.0.1
Thom Wiggers 5 anos atrás
pai
commit
15bd2d4fb4
Nenhuma chave conhecida encontrada para esta assinatura no banco de dados ID da chave GPG: 1BB0A7CE26E363
3 arquivos alterados com 12 adições e 8 exclusões
  1. +1
    -1
      appveyor.yml
  2. +9
    -5
      test/helpers.py
  3. +2
    -2
      test/test_duplicate_consistency.py

+ 1
- 1
appveyor.yml Ver arquivo

@@ -26,7 +26,7 @@ build_script:
- git fetch --all
- git checkout %APPVEYOR_REPO_BRANCH%
- git reset --hard %APPVEYOR_REPO_COMMIT%
- git diff ..origin/master
- git diff --name-only origin/master
- python -m pip install -r requirements.txt
- cd test
# Download Astyle to local folder because putting it in PATH doesn't work


+ 9
- 5
test/helpers.py Ver arquivo

@@ -145,12 +145,13 @@ def permit_test(testname, thing, *args, **kwargs):

if 'PQCLEAN_ONLY_DIFF' in os.environ:
if shutil.which('git') is not None:
# if we're on a non-master branch, and the only changes are in schemes,
# if we're on a non-master branch, and the only changes are in schemes,
# only run tests on those schemes
branch_result = subprocess.run(
['git', 'status', '--porcelain=2', '--branch'],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT
stderr=subprocess.STDOUT,
cwd="..",
)
# ensure we're in a working directory
if branch_result.returncode != 0:
@@ -167,11 +168,14 @@ def permit_test(testname, thing, *args, **kwargs):
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT
)
assert(diff_result.returncode == 0), "Got unexpected return code {}".format(diff_result.returncode)
assert diff_result.returncode == 0, \
"Got unexpected return code {}".format(diff_result.returncode)
for diff_line in diff_result.stdout.decode('utf-8').splitlines():
# don't skip test if there are any changes outside schemes
if not(diff_line.startswith('crypto_kem')) and not (diff_line.startswith('crypto_sign')):
logging.info("Running all tests as there are changes outside of schemes")
if (not diff_line.startswith('crypto_kem') and
not diff_line.startswith('crypto_sign')):
logging.info("Running all tests as there are changes "
"outside of schemes")
return True
# do test if the scheme in question has been changed
if diff_line.startswith(thing.path(base='')):


+ 2
- 2
test/test_duplicate_consistency.py Ver arquivo

@@ -9,7 +9,7 @@ import unittest
import yaml


def skipped_test(*args, **kwargs):
def _skipped_test(*args, **kwargs):
raise unittest.SkipTest("Skipped consistency check")


@@ -18,7 +18,7 @@ def test_duplicate_consistency():
for implementation in scheme.implementations:
if not helpers.permit_test('duplicate_consistency',
implementation):
yield skipped_test, implementation
yield _skipped_test, implementation
continue

if os.path.isfile(


Carregando…
Cancelar
Salvar