Repository navigation
Do not recurse when getting the metadata of an NWB file in a BIDS dataset #1317
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| schedule: | |
| - cron: '0 6 * * *' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref_name }} | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| NO_ET: 1 | |
| DANDI_PAGINATION_DISABLE_FALLBACK: "1" | |
| DANDI_TESTS_PERSIST_DOCKER_COMPOSE: "1" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - windows-2022 | |
| - windows-latest | |
| - ubuntu-latest | |
| - macos-latest # M1 architecture | |
| - macos-15-intel # non-M1 architecture | |
| python: | |
| - '3.11' # Needs quotes so YAML doesn't think it's 3.1 | |
| - '3.12' | |
| - '3.13' | |
| - '3.14' | |
| mode: | |
| - normal | |
| vendored_dandiapi: | |
| # Allow vendor information for the dandi-api instance to default to | |
| # the default values specified in | |
| # dandi/tests/data/dandiarchive-docker/docker-compose.yml | |
| - default | |
| include: | |
| - os: ubuntu-latest | |
| python: '3.11' | |
| mode: dandi-api | |
| - os: ubuntu-latest | |
| python: '3.11' | |
| mode: dandi-api | |
| vendored_dandiapi: ember-dandi | |
| instance_name: EMBER-DANDI | |
| instance_identifier: 'RRID:SCR_026700' | |
| doi_prefix: '10.82754' | |
| - os: ubuntu-latest | |
| python: 3.14 | |
| mode: obolibrary-only | |
| - os: ubuntu-latest | |
| # cannot use dev-deps on 3.11 now, see | |
| # https://github.com/hdmf-dev/hdmf-zarr/issues/406 | |
| python: '3.12' | |
| mode: dev-deps | |
| - os: ubuntu-latest | |
| python: 3.14 | |
| mode: dev-deps | |
| - os: ubuntu-latest | |
| python: '3.11' | |
| mode: nfs | |
| - os: ubuntu-latest | |
| python: '3.11' | |
| mode: lowest-deps | |
| steps: | |
| - name: Set up environment | |
| uses: actions/checkout@v7 | |
| with: | |
| # Fetch all commits so that versioneer will return something compatible | |
| # with semantic-version | |
| fetch-depth: 0 | |
| - name: Set up Python ${{ matrix.python }} | |
| uses: actions/setup-python@v7 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| - name: Install dependencies | |
| if: matrix.mode != 'lowest-deps' | |
| run: | | |
| python -m pip install --upgrade pip wheel | |
| pip install ".[extras,test]" | |
| - name: Install tox for lowest-deps mode | |
| if: matrix.mode == 'lowest-deps' | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install "tox>=4" "tox-uv>=1.11" | |
| # Set only if matrix.instance_name is defined | |
| - name: Set DANDI_TESTS_INSTANCE_NAME | |
| if: ${{ matrix.instance_name }} | |
| run: echo "DANDI_TESTS_INSTANCE_NAME=${{ matrix.instance_name }}" >> "$GITHUB_ENV" | |
| # Set only if matrix.instance_identifier is defined | |
| - name: Set DANDI_TESTS_INSTANCE_IDENTIFIER | |
| if: ${{ matrix.instance_identifier }} | |
| run: echo "DANDI_TESTS_INSTANCE_IDENTIFIER=${{ matrix.instance_identifier }}" >> "$GITHUB_ENV" | |
| # Set only if matrix.doi_prefix is defined | |
| - name: Set DANDI_TESTS_DOI_PREFIX | |
| if: ${{ matrix.doi_prefix }} | |
| run: echo "DANDI_TESTS_DOI_PREFIX=${{ matrix.doi_prefix }}" >> "$GITHUB_ENV" | |
| - name: Install dev versions of select dependencies | |
| if: matrix.mode == 'dev-deps' | |
| run: | | |
| pip install git+https://github.com/jaraco/keyring | |
| pip install git+https://github.com/NeurodataWithoutBorders/nwbinspector | |
| pip install git+https://github.com/NeurodataWithoutBorders/pynwb \ | |
| git+https://github.com/hdmf-dev/hdmf \ | |
| git+https://github.com/hdmf-dev/hdmf-zarr | |
| - name: Create NFS filesystem | |
| if: matrix.mode == 'nfs' | |
| run: | | |
| mkdir /tmp/nfsmount_ /tmp/nfsmount | |
| mkdir /tmp/nfsmount_/tmp /tmp/nfsmount_/home | |
| echo "/tmp/nfsmount_ localhost(rw)" | sudo tee /etc/exports | |
| sudo apt-get install -y nfs-kernel-server | |
| sudo exportfs -a | |
| sudo mount -t nfs localhost:/tmp/nfsmount_ /tmp/nfsmount | |
| echo TMPDIR=/tmp/nfsmount/tmp >> "$GITHUB_ENV" | |
| echo HOME=/tmp/nfsmount/home >> "$GITHUB_ENV" | |
| echo DANDI_DEVEL_INSTRUMENT_REQUESTS_SUPERLEN=1 >> "$GITHUB_ENV" | |
| - name: Use scheduled test configuration | |
| if: github.event_name == 'schedule' | |
| run: echo PYTEST_ADDOPTS=--scheduled >> "$GITHUB_ENV" | |
| - name: Run all tests except those involving obolibrary | |
| if: matrix.mode != 'dandi-api' && matrix.mode != 'obolibrary-only' && matrix.mode != 'lowest-deps' | |
| # Start coverage before pytest, which loads dandi's pytest plugin (and | |
| # thus imports most of dandi) before pytest-cov would start it | |
| run: | | |
| python -m coverage run -m pytest -s -v -m "not obolibrary" dandi | |
| python -m coverage combine | |
| python -m coverage xml | |
| - name: Run tests against minimum declared dependency versions | |
| if: matrix.mode == 'lowest-deps' | |
| run: | | |
| tox -e py3-lowest -- -s -m "not obolibrary" | |
| - name: Run only tests related to obolibrary | |
| if: matrix.mode == 'obolibrary-only' | |
| run: | | |
| python -m pytest -s -v -m obolibrary dandi | |
| - name: Smoke test example code in docs | |
| if: matrix.mode != 'dandi-api' && matrix.mode != 'lowest-deps' && github.event_name == 'schedule' | |
| run: | | |
| set -ex | |
| cd docs/source/examples | |
| for f in *.py | |
| do python "$f" | |
| done | |
| - name: Run DANDI API tests only | |
| if: matrix.mode == 'dandi-api' | |
| run: | | |
| export DANDI_TESTS_AUDIT_CSV=/tmp/audit.csv | |
| python -m coverage run -m pytest -s -v --dandi-api dandi | |
| python -m coverage combine | |
| python -m coverage xml | |
| if [ ! -e /tmp/audit.csv ] | |
| then echo Audit file not created | |
| exit 1 | |
| fi | |
| lines="$(wc -l /tmp/audit.csv | awk '{print $1}')" | |
| if [ "$lines" -lt 100 ] | |
| then echo Audit file shorter than expected - only "$lines" lines | |
| exit 1 | |
| fi | |
| - name: Dump Docker Compose logs | |
| if: failure() && startsWith(matrix.os, 'ubuntu') | |
| run: | | |
| docker compose \ | |
| -f dandi/tests/data/dandiarchive-docker/docker-compose.yml \ | |
| logs --timestamps | |
| - name: Shut down Docker Compose | |
| if: startsWith(matrix.os, 'ubuntu') | |
| run: | | |
| docker compose \ | |
| -f dandi/tests/data/dandiarchive-docker/docker-compose.yml \ | |
| down -v | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v7 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./coverage.xml | |
| flags: unittests | |
| # name: codecov-umbrella | |
| # yml: ./codecov.yml | |
| fail_ci_if_error: false |