Skip to content
Closed
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
22 changes: 19 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- 'docs/**'
pull_request:
branches: [ "main" ]
types: [opened, reopened, synchronize, labeled]
paths-ignore:
- 'docs/**'
schedule:
Expand Down Expand Up @@ -36,12 +37,27 @@ jobs:

- name: List installed libraries
run: |
pixi install --environment ${{ matrix.environment }}
pixi list --environment ${{ matrix.environment }}

- name: Running Tests
- name: Determine test type
id: test-type
run: |
pixi run -e ${{ matrix.environment }} run-tests-xml-cov
if [[ "${{ github.event_name }}" == "pull_request" ]] && \
[[ "${{ contains(github.event.pull_request.labels.*.name, 'test-slow') }}" == "true" ]]; then
echo "run-slow=true" >> $GITHUB_OUTPUT
echo "Running slow tests due to 'test-slow' label"
else
echo "run-slow=false" >> $GITHUB_OUTPUT
echo "Running standard tests (skipping slow tests)"
fi

- name: Run Tests
run: |
if [[ "${{ steps.test-type.outputs.run-slow }}" == "true" ]]; then
pixi run -e ${{ matrix.environment }} run-tests-including-slow
else
pixi run -e ${{ matrix.environment }} run-tests-xml-cov
fi

- name: Upload code coverage to Codecov
uses: codecov/[email protected]
Expand Down
20 changes: 17 additions & 3 deletions .github/workflows/minimum-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,26 @@ jobs:

- name: List installed libraries
run: |
pixi install --environment minimum-versions
pixi list --environment minimum-versions
- name: Running Tests
- name: Determine test type
id: test-type
run: |
pixi run -e minimum-versions run-tests-xml-cov
if [[ "${{ github.event_name }}" == "pull_request" ]] && \
[[ "${{ contains(github.event.pull_request.labels.*.name, 'test-slow') }}" == "true" ]]; then
echo "run-slow=true" >> $GITHUB_OUTPUT
echo "Running slow tests due to 'test-slow' label"
else
echo "run-slow=false" >> $GITHUB_OUTPUT
echo "Running standard tests (skipping slow tests)"
fi

- name: Run Tests
run: |
if [[ "${{ steps.test-type.outputs.run-slow }}" == "true" ]]; then
pixi run -e minimum-versions run-tests-including-slow
else
pixi run -e minimum-versions run-tests-xml-cov
fi
- name: Upload code coverage to Codecov
uses: codecov/[email protected]
with:
Expand Down
21 changes: 18 additions & 3 deletions .github/workflows/upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,27 @@ jobs:

- name: List installed libraries
run: |
pixi install --environment upstream
pixi list --environment upstream

- name: Running Tests
- name: Determine test type
id: test-type
run: |
pixi run -e upstream run-tests-xml-cov
if [[ "${{ github.event_name }}" == "pull_request" ]] && \
[[ "${{ contains(github.event.pull_request.labels.*.name, 'test-slow') }}" == "true" ]]; then
echo "run-slow=true" >> $GITHUB_OUTPUT
echo "Running slow tests due to 'test-slow' label"
else
echo "run-slow=false" >> $GITHUB_OUTPUT
echo "Running standard tests (skipping slow tests)"
fi

- name: Run Tests
run: |
if [[ "${{ steps.test-type.outputs.run-slow }}" == "true" ]]; then
pixi run -e upstream run-tests-including-slow
else
pixi run -e upstream run-tests-xml-cov
fi

- name: Upload code coverage to Codecov
uses: codecov/[email protected]
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ run-mypy = { cmd = "mypy virtualizarr" }
# Using '--dist loadscope' (rather than default of '--dist load' when '-n auto'
# is used), reduces test hangs that appear to be macOS-related.
run-tests = { cmd = "pytest -n auto --dist loadscope --run-network-tests --verbose --durations=10" }
run-tests-including-slow = { cmd = "pytest -n auto --dist loadscope --run-network-tests --run-slow-tests --verbose --durations=10" }
run-tests-including-slow = { cmd = "pytest -n auto --dist loadscope --run-network-tests --run-slow-tests --verbose --durations=10 --cov=virtualizarr --cov-report=xml" }
run-tests-no-network = { cmd = "pytest -n auto --verbose" }
run-tests-cov = { cmd = "pytest -n auto --run-network-tests --verbose --cov=virtualizarr --cov=term-missing" }
run-tests-xml-cov = { cmd = "pytest -n auto --run-network-tests --verbose --cov=virtualizarr --cov-report=xml" }
Expand Down Expand Up @@ -206,6 +206,7 @@ readthedocs = { cmd = "rm -rf $READTHEDOCS_OUTPUT/html && cp -r site $READTHEDOC
[tool.pixi.feature.minio.tasks]
run-tests = { cmd = "pytest virtualizarr/tests/test_manifests/test_store.py virtualizarr/tests/test_parsers/test_hdf/test_hdf_manifest_store.py --run-minio-tests --run-network-tests --verbose" }
run-tests-xml-cov = { cmd = "pytest virtualizarr/tests/test_manifests/test_store.py virtualizarr/tests/test_parsers/test_hdf/test_hdf_manifest_store.py --run-minio-tests --run-network-tests --verbose --cov-report=xml" }
run-tests-including-slow= { cmd = "pytest virtualizarr/tests/test_manifests/test_store.py virtualizarr/tests/test_parsers/test_hdf/test_hdf_manifest_store.py --run-minio-tests --run-network-tests --run-slow-tests --verbose --cov-report=xml" }

[tool.setuptools_scm]
fallback_version = "9999"
Expand Down
Loading