Skip to content

Commit 8bc2ba9

Browse files
committed
ci: added minimal testing setup
1 parent 10ec6a2 commit 8bc2ba9

File tree

5 files changed

+38
-2
lines changed

5 files changed

+38
-2
lines changed

.github/workflows/test.yml

+8
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ jobs:
6666
fi
6767
eegnb --help
6868
eegnb runexp --help
69+
- name: Run examples with coverage
70+
shell: bash
71+
run: |
72+
if [ "$RUNNER_OS" == "Linux" ]; then
73+
Xvfb :0 -screen 0 1024x768x24 -ac +extension GLX +render -noreset &> xvfb.log &
74+
export DISPLAY=:0
75+
fi
76+
pytest
6977
7078
typecheck:
7179
runs-on: ${{ matrix.os }}

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,8 @@ doc/_build
99

1010
# Built by auto_examples
1111
examples/visual_cueing/*.csv
12+
13+
# tests/coverage artifacts
14+
.coverage
15+
coverage.xml
16+
htmlcov

eegnb/experiments/visual_baselinetask/baseline_task.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
start = time()
1919

2020
# Initialize stimuli
21-
aud1 = sound.Sound("C", octave=5, sampleRate=44100, secs=0.5, bits=8)
21+
aud1 = sound.Sound("C", octave=5, sampleRate=44100, secs=0.5)
2222
aud1.setVolume(0.025)
2323

2424
# Setup graphics

pyproject.toml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[tool.pytest.ini_options]
2+
minversion = "6.0"
3+
addopts = """
4+
--cov=eegnb
5+
--cov-report=term
6+
--cov-report=xml
7+
--cov-report=html
8+
--nbval-lax
9+
--current-env
10+
--ignore-glob 'examples/**.py'
11+
--ignore-glob '**/baseline_task.py'
12+
"""
13+
testpaths = [
14+
"eegnb",
15+
"examples",
16+
]
17+
python_files = ["*.py", "*.ipynb"]

requirements.txt

+7-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ pysocks==1.7.1
1414
pyserial==3.5
1515
h5py>=3.1.0
1616
pyo>=1.0.3; platform_system == "Linux"
17+
18+
# This might try to build from source on linux (since there are no wheels for Linux on PyPI)
19+
# 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.
1720
wxPython>=4.0 ; platform_system == "Linux"
1821
click
1922

@@ -26,7 +29,10 @@ pywinhook>=1.6.0 ; platform_system == "Windows" and (python_version == "3.7" or
2629
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"
2730

2831
# Test requirements
29-
mypy>=0.790
32+
mypy
33+
pytest
34+
pytest-cov
35+
nbval
3036

3137
# Docs requirements
3238
sphinx==3.1.1

0 commit comments

Comments
 (0)