Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test suite issues #26 and #27 #28

Merged
merged 4 commits into from
Jul 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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