Skip to content

Commit

Permalink
Merge pull request #28 from cfv-project/fix-test-suite-issues
Browse files Browse the repository at this point in the history
Fix test suite issues #26 and #27
  • Loading branch information
lxp authored Jul 31, 2021
2 parents 0dba5cd + 5060800 commit 9796352
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 19 deletions.
37 changes: 19 additions & 18 deletions .github/workflows/ci-python3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
test:
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-20.04, ubuntu-18.04]
python-version: ['3.5', '3.6', '3.7', '3.8', '3.9']
os: [ ubuntu-20.04, ubuntu-18.04 ]
python-version: [ '3.5', '3.6', '3.7', '3.8', '3.9' ]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand All @@ -31,44 +31,45 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install test dependencies
run: |
pip install pyroma
pip install check-manifest
pip install twine
pip install wheel
pip install flake8
pip list
sudo apt install coreutils cksfv
pip install pyroma
pip install check-manifest
pip install twine
pip install wheel
pip install flake8
pip list
- name: Check syntax by compiling code
run: python -m compileall -f .

- name: Run unit tests
run: python -bb test/test.py --unit --exit-early

- name: Run integration tests (internal)
run: |
ulimit -n
ulimit -n 4096
python -bb test/test.py -i --exit-early
- name: Run integration tests (external process)
run: |
ulimit -n
ulimit -n 4096
test/test.py -e --exit-early
- name: Check package quality
run: pyroma -n 9 .

- name: Check the completeness of MANIFEST.in
run: check-manifest --ignore=Release.md .

- name: Run flake
continue-on-error: true
run: flake8 --exclude=build,venv --ignore= --max-line-length=200 --max-complexity=75 --show-source --statistics .

- name: Check distribution
run: |
python setup.py sdist bdist_wheel
Expand Down
10 changes: 9 additions & 1 deletion test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1712,11 +1712,17 @@ def cfv_torrentcommentencoding_test(s, o):
test_generic(cfvcmd + ' -r -u -p a ' + os.path.join('C', 'foo.bar'), cfv_test)
test_generic(cfvcmd + ' -ri -u -p a ' + os.path.join('c', 'fOo.BaR'), cfv_test)

def cfv_notfound_or_bad_test(path):
if os.path.exists(path):
return cfv_bad_test
else:
return cfv_notfound_test

test_generic(cfvcmd + ' --strippaths=0 -T -f teststrip0.csv4', cfv_test)
test_generic(cfvcmd + ' --strippaths=1 -T -f teststrip1.csv4', cfv_test)
test_generic(cfvcmd + ' --strippaths=2 -T -f teststrip2.csv4', cfv_test)
test_generic(cfvcmd + ' --strippaths=all -T -f teststrip-1.csv4', cfv_test)
test_generic(cfvcmd + ' --strippaths=none -T -f teststrip-none.csv4', cfv_notfound_test)
test_generic(cfvcmd + ' --strippaths=none -T -f teststrip-none.csv4', cfv_notfound_or_bad_test('/data1'))
test_generic(cfvcmd + r' --strippaths=0 --fixpaths \\/ -T -f testdrivestrip.md5', rcurry(cfv_all_test, ok=4))
test_generic(cfvcmd + r' --strippaths=0 --unquote=yes --fixpaths \\/ -T -f testdrivestripquoted.md5', rcurry(cfv_all_test, ok=4))
test_generic(cfvcmd + r' --strippaths=0 --unquote=yes --fixpaths \\/ -T -f testdrivestripquoted.md5 data1 data3 data4', rcurry(cfv_all_test, ok=3))
Expand All @@ -1736,13 +1742,15 @@ def cfv_torrentcommentencoding_test(s, o):
def coreutils_verify(f):
test_external(fmt + 'sum -c ' + f, status_test)
else:
print('skipping %s verify using external tool %ssum, as it is not installed.' % (fmt, fmt))
coreutils_verify = None
C_test(fmt, verify=coreutils_verify)
C_test('csv')
if pathfind('cksfv'): # don't report pointless errors on systems that don't have cksfv
def sfvverify(f):
test_external('cksfv -f ' + f, status_test)
else:
print('skipping sfv verify using external tool cksfv, as it is not installed.')
sfvverify = None
C_test('sfv', verify=sfvverify)
C_test('sfvmd5', '-t sfvmd5')
Expand Down

0 comments on commit 9796352

Please sign in to comment.