Skip to content

Commit

Permalink
Merge branch '1.x' into 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
remram44 committed Jul 19, 2021
2 parents 411a1a8 + 929af95 commit ec08038
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,17 @@ jobs:
if [ "$TEST_MODE" = "coverage" ]; then
export COVER="coverage run --append --source=$PWD --branch"
fi
python tests --unittests
python -Wd tests --unittests
- name: Functional test
run: |
export PYTHONUNBUFFERED=1
export REPROZIP_TEST_PYTHON="$(which python) -Wd"
if [ "$TEST_MODE" = "coverage" ]; then
export COVER="coverage run --append --source=$PWD --branch"
python -Wd -m $COVER -m tests --functests --run-docker
else
python -Wd tests --functests --run-docker
fi
python tests --functests --run-docker
- name: Upload coverage
if: matrix.mode == 'coverage'
run: |
Expand Down
22 changes: 10 additions & 12 deletions tests/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,25 +148,23 @@ def same_files(file1, file2, CHUNK_SIZE=4096):

@in_temp_dir
def functional_tests(raise_warnings, interactive, run_vagrant, run_docker):
rpz_python = [os.environ.get('REPROZIP_PYTHON', sys.executable)]
rpuz_python = [os.environ.get('REPROUNZIP_PYTHON', sys.executable)]
python_exe = os.environ.get('REPROZIP_TEST_PYTHON', sys.executable)
python_exe = python_exe.split(' ')

# Can't match on the SignalWarning category here because of a Python bug
# http://bugs.python.org/issue22543
if raise_warnings:
rpz_python.extend(['-W', 'error:signal'])
rpuz_python.extend(['-W', 'error:signal'])
python_exe.extend(['-W', 'error:signal'])

if 'COVER' in os.environ:
rpz_python.extend(['-m'] + os.environ['COVER'].split(' '))
rpuz_python.extend(['-m'] + os.environ['COVER'].split(' '))
python_exe.extend(['-m'] + os.environ['COVER'].split(' '))

reprozip_main = tests.parent / 'reprozip/reprozip/__main__.py'
reprounzip_main = tests.parent / 'reprounzip/reprounzip/__main__.py'

verbose = ['-v'] * 3
rpz = rpz_python + [reprozip_main.absolute()] + verbose
rpuz = rpuz_python + [reprounzip_main.absolute()] + verbose
rpz = python_exe + [reprozip_main.absolute()] + verbose
rpuz = python_exe + [reprounzip_main.absolute()] + verbose

print("Command lines are:\n%r\n%r" % (rpz, rpuz), file=sys.stderr)

Expand Down Expand Up @@ -280,7 +278,7 @@ def check_simple(args, stream, infile=1):
out, err = p.communicate()
assert p.poll() != 0
err = err.splitlines()
while b"DeprecationWarning" in err[0]:
while b"DeprecationWarning" in err[0] or b"ImportWarning" in err[0]:
err = err[2:]
assert b"Wrong unpacker used" in err[0]
assert err[1].startswith(b"usage: ")
Expand Down Expand Up @@ -332,7 +330,7 @@ def check_simple(args, stream, infile=1):
out, err = p.communicate()
assert p.poll() != 0
err = err.splitlines()
while b"DeprecationWarning" in err[0]:
while b"DeprecationWarning" in err[0] or b"ImportWarning" in err[0]:
err = err[2:]
assert b"Wrong unpacker used" in err[0]
assert err[1].startswith(b"usage:")
Expand All @@ -348,7 +346,7 @@ def check_simple(args, stream, infile=1):
orig_output_location)
# Run using reprounzip-vistrails
check_simple(
sudo + rpuz_python +
sudo + python_exe +
['-m', 'reprounzip_vistrails', '1',
'chroot', 'simplechroot_vt', '0',
'--input-file', 'arg1:%s' % (tests / 'simple_input2.txt'),
Expand Down Expand Up @@ -866,7 +864,7 @@ def check_simple(args, stream, infile=1):
out, err = p.communicate()
assert p.poll() != 0
err = err.splitlines()
while b"DeprecationWarning" in err[0]:
while b"DeprecationWarning" in err[0] or b"ImportWarning" in err[0]:
err = err[2:]
assert b"Wrong unpacker used" in err[0]
assert err[1].startswith(b"usage: ")
Expand Down

0 comments on commit ec08038

Please sign in to comment.