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

Add workflow for testing dandischema against latest release of dandi-cli #49

Merged
merged 4 commits into from
Jul 6, 2021
Merged
Changes from 1 commit
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
76 changes: 76 additions & 0 deletions .github/workflows/test-dandi-cli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Test against dandi-cli

on:
push:
jwodder marked this conversation as resolved.
Show resolved Hide resolved
pull_request:
schedule:
- cron: '0 6 * * *'

jobs:
test-dandi-cli:
runs-on: ${{ matrix.os }}
env:
NO_ET: 1
strategy:
fail-fast: false
matrix:
os:
- windows-2019
- ubuntu-18.04
- macos-latest
python:
- 3.7
- 3.8
- 3.9
mode:
- normal
include:
- os: ubuntu-18.04
python: 3.7
mode: dandi-devel
exclude:
# Temporarily disabled due to h5py/hdf5 dependency issue
# See <https://github.com/dandi/dandi-cli/pull/315>
- os: windows-2019
python: 3.9
steps:
- name: Check out dandischema
uses: actions/checkout@v2
with:
# Fetch all commits so that versioneer will return something
# compatible with semantic-version
fetch-depth: 0
path: dandischema

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Install dandischema
run: |
python -m pip install --upgrade pip wheel
pip install .
working-directory: dandischema

- name: Install hdf5 (Ubuntu)
if: matrix.python == '3.9' && startsWith(matrix.os, 'ubuntu')
run: sudo apt-get update && sudo apt-get install -y libhdf5-dev

- name: Install hdf5 (macOS)
if: matrix.python == '3.9' && startsWith(matrix.os, 'macos')
run: |
brew install [email protected]
brew link [email protected]

- name: Install dandi
run: pip install "dandi[test]"

- name: Set DANDI_DEVEL=1
if: matrix.mode == 'dandi-devel'
run: echo DANDI_DEVEL=1 >> "$GITHUB_ENV"

- name: Run dandi-cli tests
run: |
python -m pytest -s -v \
"$pythonLocation/lib/python${{ matrix.python }}/site-packages/dandi"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not simpler

python -m pytest -s -v --pyargs dandi

IMHO worth a comment... also would it work on windows? not sure if it is a contributing factor to windows fails like

=================================== ERRORS ====================================
________________________ ERROR collecting test session ________________________
C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\_pytest\runner.py:311: in from_call
    result: Optional[TResult] = func()
C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\_pytest\runner.py:341: in <lambda>
    call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\_pytest\main.py:690: in collect
    for direntry in visit(str(argpath), self._recurse):
C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\_pytest\pathlib.py:606: in visit
    yield from visit(entry.path, recurse)
C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\_pytest\pathlib.py:591: in visit
    for entry in os.scandir(path):
E   PermissionError: [WinError 5] Access is denied: 'D:\\System Volume Information'
=========================== short test summary info ===========================
ERROR ..\..\.. - PermissionError: [WinError 5] Access is denied: 'D:\\System ...
!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
============================== 1 error in 0.20s ===============================

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--pyargs dandi doesn't pick up conftest.py; see pytest-dev/pytest#1596. I don't know what's going on with Windows.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eh, odd. But do we need that conftest.py for this purpose if we aren't using --dandi-api option here?

Let's skip windows here for now, and create a dedicated issue to be fixed later

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using --pyargs dandi works, even on Windows.