Skip to content

Commit b47479e

Browse files
committed
ci: added minimal testing setup
1 parent beaa8a5 commit b47479e

File tree

5 files changed

+38
-2
lines changed

5 files changed

+38
-2
lines changed

.github/workflows/test.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ jobs:
5959
eegnb --help
6060
echo "second test: runexp with no args"
6161
eegnb runexp
62+
- name: Run examples with coverage
63+
shell: bash
64+
run: |
65+
if [ "$RUNNER_OS" == "Linux" ]; then
66+
Xvfb :0 -screen 0 1024x768x24 -ac +extension GLX +render -noreset &> xvfb.log &
67+
export DISPLAY=:0
68+
fi
69+
pytest
6270
6371
typecheck:
6472
runs-on: ${{ matrix.os }}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,8 @@ doc/_build
88

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

eegnb/experiments/visual_baselinetask/baseline_task.py

Lines changed: 1 addition & 1 deletion
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

Lines changed: 17 additions & 0 deletions
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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,16 @@ pywinhook==1.6.0; platform_system == "Windows"
1616
pyserial==3.5
1717
h5py>=3.1.0
1818
pyo>=1.0.3; platform_system == "Linux"
19+
20+
# This might try to build from source on linux (since there are no wheels for Linux on PyPI)
21+
# 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.
1922
wxPython>=4.0 ; platform_system == "Linux"
2023

2124
# Test requirements
22-
mypy>=0.790
25+
mypy
26+
pytest
27+
pytest-cov
28+
nbval
2329

2430
# Docs requirements
2531
sphinx==3.1.1

0 commit comments

Comments
 (0)