mirror of
https://github.com/blw1138/Zordon.git
synced 2026-06-09 13:39:24 -05:00
Add Unit Tests (#132)
* Add tests and new github workflow * Add new unit tests * Add Github CI workflow * Workflow fix * Add pytest install to workflow file * More CI / test updates * More test cleanup * Whitespace cleanup and link complexity override * More whitespace cleanup * Make lint less strict * More lint tweaks
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Install system deps
|
||||
run: sudo apt-get update && sudo apt-get install -y libxcb-cursor0 libxcb-xinerama0 blender
|
||||
|
||||
- name: Install Python deps
|
||||
run: |
|
||||
pip install -r requirements.txt
|
||||
pip install pytest flake8 pylint
|
||||
|
||||
- name: Test
|
||||
run: python -m pytest tests/ --ignore=tests/job_creation_tests.py -v
|
||||
|
||||
- name: Lint — bugs (flake8)
|
||||
# Fails on syntax errors only. Ignored: ~100+ pre-existing
|
||||
# style issues (E/W), star-import false positives (F403/F405),
|
||||
# unused imports (F401), unused vars (F841), f-string debt (F541).
|
||||
run: flake8 --select=E9 --exclude=src/engines/aerender,build,dist,.git,__pycache__,venv --max-line-length=127 --max-complexity=35
|
||||
|
||||
- name: Lint — style (flake8)
|
||||
# Reports style issues but never fails the build.
|
||||
# TODO: resolve ~100+ pre-existing style issues
|
||||
run: flake8 --exit-zero --exclude=src/engines/aerender,build,dist,.git,__pycache__,venv --max-line-length=127 --max-complexity=35
|
||||
|
||||
- name: Lint (pylint)
|
||||
# Reports all issues but never fails the build.
|
||||
# TODO: resolve pre-existing debt (current score 7.73/10)
|
||||
run: pylint src/ --max-line-length=120 --ignore-paths=^src/engines/aerender/ --fail-under=0
|
||||
Reference in New Issue
Block a user