Skip to content

Commit

Permalink
[Fix] Ignore test timm when torch<1.7 (open-mmlab#2158)
Browse files Browse the repository at this point in the history
  • Loading branch information
MeowZheng authored Oct 8, 2022
1 parent b732fae commit 00c5e80
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
12 changes: 2 additions & 10 deletions .circleci/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,6 @@ jobs:
name: Build and install
command: |
pip install -e .
- run:
name: Run unittests
command: |
pip install timm
coverage run --branch --source mmseg -m pytest tests/
coverage xml
coverage report -m
- run:
name: Skip timm unittests and generate coverage report
command: |
Expand Down Expand Up @@ -121,10 +114,9 @@ jobs:
command: |
docker exec mmseg pip install -e .
- run:
name: Run unittests
name: Run unittests but skip timm unittests
command: |
docker exec mmseg pip install timm
docker exec mmseg pytest tests/
docker exec mmseg pytest tests/ --ignore tests/test_models/test_backbones/test_timm_backbone.py
workflows:
pr_stage_lint:
when: << pipeline.parameters.lint_only >>
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/merge_stage_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,19 @@ jobs:
- name: Build and install
run: rm -rf .eggs && pip install -e .
- name: Run unittests and generate coverage report
# timm from v0.6.11 requires torch>=1.7
if: ${{matrix.torch >= '1.7.0'}}
run: |
pip install timm
coverage run --branch --source mmseg -m pytest tests/
coverage xml
coverage report -m
# Only upload coverage report for python3.7 && pytorch1.8.1 cpu
- name: Skip timm unittests and generate coverage report
run: |
coverage run --branch --source mmseg -m pytest tests/ --ignore tests/test_models/test_backbones/test_timm_backbone.py
coverage xml
coverage report -m
# Only upload coverage report for python3.7 && pytorch1.8.1 without timm
- name: Upload coverage to Codecov
if: ${{matrix.torch == '1.8.1' && matrix.python-version == '3.7'}}
uses: codecov/codecov-action@v2
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/pr_stage_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,10 @@ jobs:
run: rm -rf .eggs && pip install -e .
- name: Run unittests and generate coverage report
run: |
pip install timm
coverage run --branch --source mmseg -m pytest tests/
coverage run --branch --source mmseg -m pytest tests/ --ignore tests/test_models/test_backbones/test_timm_backbone.py
coverage xml
coverage report -m
# Upload coverage report for python3.7 && pytorch1.8.1 cpu
# Upload coverage report for python3.7 && pytorch1.8.1 cpu without timm
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
Expand Down

0 comments on commit 00c5e80

Please sign in to comment.