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

Tests-CI #41

Merged
merged 67 commits into from
Jun 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
e456c55
add ci tests
bendichter Jun 7, 2022
ff7eaa7
Update test.yml
bendichter Jun 7, 2022
cbb7e06
Update test.yml
bendichter Jun 7, 2022
2ced167
change import
bendichter Jun 7, 2022
4b86595
add pandas
bendichter Jun 7, 2022
8738260
add scipy
bendichter Jun 7, 2022
cfaf3d5
add scikit-learn
bendichter Jun 7, 2022
7cffbc9
fix save
bendichter Jun 7, 2022
1acfb8d
install singularity
bendichter Jun 7, 2022
6670787
pytest verbose
bendichter Jun 7, 2022
92ca475
take away pandas
bendichter Jun 7, 2022
5dfd7ec
use generate_recording
bendichter Jun 7, 2022
07f315d
use spikeinterface full
bendichter Jun 7, 2022
255901e
add trideclous
bendichter Jun 7, 2022
284c76c
add ironclust
bendichter Jun 8, 2022
b4ce94a
fix runner
bendichter Jun 8, 2022
66e08e9
Update .github/workflows/test.yml
bendichter Jun 14, 2022
5ab7dc9
Add all tests
alejoe91 Jun 15, 2022
28df6a5
Some fixes
alejoe91 Jun 16, 2022
668e603
Update tests/test_singularity_containers.py
bendichter Jun 16, 2022
b17da94
Update tests/test_singularity_containers.py
bendichter Jun 16, 2022
4216004
Update tests/test_singularity_containers.py
bendichter Jun 16, 2022
08631d9
Update tests/test_singularity_containers.py
bendichter Jun 16, 2022
6210000
apply black formatting
bendichter Jun 16, 2022
f241e18
refactor tests
bendichter Jun 16, 2022
a876921
fix recording arg
bendichter Jun 16, 2022
b17afae
Added work_dir and recording fixtures
chyumin Jun 16, 2022
788772f
Merge branch 'add_ci_tests' of github.com:Tauffer-Consulting/spikeint…
chyumin Jun 16, 2022
31746b4
merge updates
chyumin Jun 16, 2022
e0a56cd
Testing with toy data
chyumin Jun 17, 2022
382f101
Added requirements_test.txt
chyumin Jun 17, 2022
2d576eb
test workflow
chyumin Jun 17, 2022
d78b114
workflow
chyumin Jun 17, 2022
3a685c7
Test images
chyumin Jun 17, 2022
8b6bd87
reduce duration, install tridesclous, print sorting
chyumin Jun 17, 2022
54d30df
add workflow_dispatch
chyumin Jun 18, 2022
e823680
test manual
chyumin Jun 18, 2022
12f6023
Merge branch 'add_ci_tests' into main
chyumin Jun 18, 2022
7b582b4
Build job
chyumin Jun 18, 2022
e8c8c64
job dep
chyumin Jun 18, 2022
dbd81fd
fix perm denied
chyumin Jun 18, 2022
f09d5e7
fix retention-days
chyumin Jun 18, 2022
c82b4d7
Update requirements
chyumin Jun 18, 2022
34a2963
change req - temp
chyumin Jun 19, 2022
1d7b9d8
remove matrix for build
chyumin Jun 19, 2022
c7a125d
Add test changed_files
chyumin Jun 19, 2022
3c3fbf8
test set-matrix job
chyumin Jun 20, 2022
211d3bf
udpate
chyumin Jun 20, 2022
557768a
use action files filter
chyumin Jun 20, 2022
81185d6
Remove build
chyumin Jun 20, 2022
d3df316
rename and small fix
chyumin Jun 20, 2022
6f01fd3
fix pytest run
chyumin Jun 20, 2022
a42c007
update requirement
chyumin Jun 20, 2022
0329be3
Start push image step
chyumin Jun 20, 2022
1c14599
Renames
chyumin Jun 20, 2022
c919e6c
only ci-tests
chyumin Jun 20, 2022
92c2cbe
skip ks1
chyumin Jun 20, 2022
c01b985
Remove mountainsort4 skip test
chyumin Jun 22, 2022
cd3a24c
Merge remote-tracking branch 'upstream/main' into main
chyumin Jun 22, 2022
b3d2d70
Merge branch 'main' into ci-tests
chyumin Jun 22, 2022
cc85c3c
blankline
chyumin Jun 23, 2022
5bc735a
Merge remote-tracking branch 'upstream/main' into main
chyumin Jun 24, 2022
951ca5b
Merge branch 'main' into ci-tests
chyumin Jun 24, 2022
99f1eb9
remove skip ks1
chyumin Jun 24, 2022
7e8c260
change source to main
chyumin Jun 24, 2022
ebc7781
Earlier tests cleanup to save space
chyumin Jun 24, 2022
5556fa9
disabling singularity cache for tests
chyumin Jun 24, 2022
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
35 changes: 35 additions & 0 deletions .github/workflows/test_containers_singularity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test sorter images in singularity

on:
workflow_dispatch:
pull_request:
branches: [main]
types: [synchronize, opened, reopened, ready_for_review]

jobs:
test-images:
name: Test on (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# "macos-latest", "windows-latest"
os: ["ubuntu-latest", ]
steps:
- uses: actions/checkout@v3
with:
python-version: 3.8

- uses: eWaterCycle/setup-singularity@v7
with:
singularity-version: 3.8.3

- name: Install dependencies
run: |
pip install tridesclous
pip install -r requirements_test.txt

- name: Run test singularity containers
run: |
pip install tridesclous
pytest -sv tests/test_singularity_containers.py
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__pycache__
4 changes: 4 additions & 0 deletions requirements_test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
git+https://github.com/SpikeInterface/spikeinterface.git#egg=spikeinterface[full]
docker==5.0.3
spython==0.2.1
pytest==7.1.2
101 changes: 101 additions & 0 deletions tests/test_singularity_containers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import os
import shutil

import pytest

import spikeinterface.extractors as se
import spikeinterface.sorters as ss

os.environ['SINGULARITY_DISABLE_CACHE'] = 'true'


@pytest.fixture(autouse=True)
def work_dir(request, tmp_path):
"""
This fixture, along with "run_kwargs" creates one folder per
test function using built-in tmp_path pytest fixture

The tmp_path will be the working directory for the test function

At the end of the each test function, a clean up will be done
"""
os.chdir(tmp_path)
yield
os.chdir(request.config.invocation_dir)
shutil.rmtree(str(tmp_path))


@pytest.fixture
def run_kwargs(work_dir):
test_recording, _ = se.toy_example(
duration=30,
seed=0,
num_channels=64,
num_segments=1
)
test_recording = test_recording.save(name='toy')
return dict(recording=test_recording, verbose=True, singularity_image=True)


def test_spykingcircus(run_kwargs):
sorting = ss.run_spykingcircus(output_folder="spykingcircus", **run_kwargs)
print(sorting)


def test_mountainsort4(run_kwargs):
sorting = ss.run_mountainsort4(output_folder="mountainsort4", **run_kwargs)
print(sorting)


def test_tridesclous(run_kwargs):
sorting = ss.run_tridesclous(output_folder="tridesclous", **run_kwargs)
print(sorting)


def test_klusta(run_kwargs):
sorting = ss.run_klusta(output_folder="klusta", **run_kwargs)
print(sorting)


def test_ironclust(run_kwargs):
sorting = ss.run_ironclust(output_folder="ironclust", fGpu=False, **run_kwargs)
print(sorting)


def test_waveclus(run_kwargs):
sorting = ss.run_waveclus(output_folder="waveclus", **run_kwargs)
print(sorting)


def test_hdsort(run_kwargs):
sorting = ss.run_hdsort(output_folder="hdsort", **run_kwargs)
print(sorting)


def test_kilosort1(run_kwargs):
sorting = ss.run_kilosort(output_folder="kilosort", useGPU=False, **run_kwargs)
print(sorting)


@pytest.mark.skip(reason="GPU required")
def test_kilosort2(run_kwargs):
sorting = ss.run_kilosort2(output_folder="kilosort2", **run_kwargs)
print(sorting)


@pytest.mark.skip(reason="GPU required")
def test_kilosort2_5(run_kwargs):
sorting = ss.run_kilosort2_5(output_folder="kilosort2_5", **run_kwargs)
print(sorting)


@pytest.mark.skip(reason="GPU required")
def test_kilosort3(run_kwargs):
sorting = ss.run_kilosort3(output_folder="kilosort3", **run_kwargs)
print(sorting)


@pytest.mark.skip(reason="GPU required")
def test_pykilosort(run_kwargs):
sorting = ss.run_pykilosort(output_folder="pykilosort", **run_kwargs)
print(sorting)