Skip to content
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
32 changes: 18 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
name: Validation
name: Run Tests

on:
push:
branches: [main]
pull_request:
branches: [main]


jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install jsonschema requests
- name: Validate
run: |
python validate_probes.py
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install jsonschema requests pytest

- name: Run tests
run: |
python -m pytest tests.py -v
10 changes: 6 additions & 4 deletions validate_probes.py → tests.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import glob
import jsonschema
import json

import jsonschema
import pytest
import requests

schema_url = "https://raw.githubusercontent.com/SpikeInterface/probeinterface/main/resources/probe.json.schema"
Expand All @@ -10,9 +12,9 @@

files = glob.glob("*/*/*.json")

print("Validating the following files:")
for file in files:
print(file)

@pytest.mark.parametrize("file", files)
def test_valid_probe_dict(file):
with open(file) as f:
data = json.load(f)
jsonschema.validate(data, response.json())
Loading