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

ci: added minimal testing setup with coverage #88

Merged
merged 2 commits into from
May 20, 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
8 changes: 8 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ jobs:
fi
eegnb --help
eegnb runexp --help
- name: Run examples with coverage
shell: bash
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
Xvfb :0 -screen 0 1024x768x24 -ac +extension GLX +render -noreset &> xvfb.log &
export DISPLAY=:0
fi
pytest

typecheck:
runs-on: ${{ matrix.os }}
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ doc/_build

# Built by auto_examples
examples/visual_cueing/*.csv

# tests/coverage artifacts
.coverage
coverage.xml
htmlcov
2 changes: 1 addition & 1 deletion eegnb/experiments/visual_baselinetask/baseline_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
start = time()

# Initialize stimuli
aud1 = sound.Sound("C", octave=5, sampleRate=44100, secs=0.5, bits=8)
aud1 = sound.Sound("C", octave=5, sampleRate=44100, secs=0.5)
aud1.setVolume(0.025)

# Setup graphics
Expand Down
18 changes: 18 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[tool.pytest.ini_options]
minversion = "6.0"
addopts = """
--cov=eegnb
--cov-report=term
--cov-report=xml
--cov-report=html
--nbval-lax
--current-env
--ignore-glob 'examples/**.py'
--ignore-glob '**/baseline_task.py'
"""
testpaths = [
"eegnb",
"tests",
#"examples",
]
python_files = ["*.py", "*.ipynb"]
8 changes: 7 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ pysocks==1.7.1
pyserial==3.5
h5py>=3.1.0
pyo>=1.0.3; platform_system == "Linux"

# This might try to build from source on linux (since there are no wheels for Linux on PyPI)
# You can pass `--find-links=https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-20.04/` your `pip install` to use the prebuilt wheels at the link.
wxPython>=4.0 ; platform_system == "Linux"
click

Expand All @@ -26,7 +29,10 @@ pywinhook>=1.6.0 ; platform_system == "Windows" and (python_version == "3.7" or
pywinhook @ https://github.com/ActivityWatch/wheels/raw/master/pywinhook/pyWinhook-1.6.2-cp39-cp39-win_amd64.whl ; platform_system == "Windows" and python_version == "3.9"

# Test requirements
mypy>=0.790
mypy
pytest
pytest-cov
nbval

# Docs requirements
sphinx==3.1.1
Expand Down
2 changes: 2 additions & 0 deletions tests/test_empty.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def test_empty():
assert True