diff --git a/.github/workflows/merge_stage_test.yml b/.github/workflows/merge_stage_test.yml index 81b973ef69..b445e92746 100644 --- a/.github/workflows/merge_stage_test.yml +++ b/.github/workflows/merge_stage_test.yml @@ -232,50 +232,48 @@ jobs: coverage xml coverage report -m - build_macos: - runs-on: macos-latest - strategy: - matrix: - python-version: [3.8] - torch: [1.6.0, 1.8.1, 1.13.0, 2.1.0] - include: - - torch: 1.6.0 - torchvision: 0.7.0 - - torch: 1.8.1 - torchvision: 0.9.1 - - torch: 1.13.0 - torchvision: 0.14.0 - - torch: 2.1.0 - torchvision: 0.16.0 - steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.7 - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Upgrade pip - run: pip install pip --upgrade - - name: Upgrade wheel - run: pip install wheel --upgrade - - name: Install PyTorch - run: pip install torch==${{ matrix.torch }} torchvision==${{ matrix.torchvision }} - - name: Build MMEngine from source - run: pip install -e . -v - - name: Install unit tests dependencies - run: | - pip install -r requirements/tests.txt - - name: Install mmcv - run: | - pip install openmim - mim install mmcv - if: ${{ matrix.torch > '1.8.0' || matrix.torch == '1.8.0' }} - # Distributed-related unit tests may fail in macOS - # Skip testing setup_env since it does not work in the current CI environment # TODO - - name: Run unittests and generate coverage report - run: | - coverage run --branch --source mmengine -m pytest tests/ --ignore tests/test_dist/ --ignore tests/test_utils/test_dl_utils/test_setup_env.py - coverage xml - coverage report -m + # build_macos: + # runs-on: macos-latest + # strategy: + # matrix: + # python-version: [3.8] + # torch: [1.6.0, 1.8.1, 1.13.0] + # include: + # - torch: 1.6.0 + # torchvision: 0.7.0 + # - torch: 1.8.1 + # torchvision: 0.9.1 + # - torch: 1.13.0 + # torchvision: 0.14.0 + # steps: + # - uses: actions/checkout@v3 + # - name: Set up Python 3.7 + # uses: actions/setup-python@v4 + # with: + # python-version: ${{ matrix.python-version }} + # - name: Upgrade pip + # run: pip install pip --upgrade + # - name: Upgrade wheel + # run: pip install wheel --upgrade + # - name: Install PyTorch + # run: pip install torch==${{ matrix.torch }} torchvision==${{ matrix.torchvision }} + # - name: Build MMEngine from source + # run: pip install -e . -v + # - name: Install unit tests dependencies + # run: | + # pip install -r requirements/tests.txt + # - name: Install mmcv + # run: | + # pip install openmim + # mim install mmcv + # if: ${{ matrix.torch > '1.8.0' || matrix.torch == '1.8.0' }} + # # Distributed-related unit tests may fail in macOS + # # Skip testing setup_env since it does not work in the current CI environment # TODO + # - name: Run unittests and generate coverage report + # run: | + # coverage run --branch --source mmengine -m pytest tests/ --ignore tests/test_dist/ --ignore tests/test_utils/test_dl_utils/test_setup_env.py + # coverage xml + # coverage report -m build_windows: runs-on: windows-2022 @@ -283,13 +281,9 @@ jobs: matrix: python-version: [3.7] platform: [cpu, cu111] - torch: [1.8.1, 2.1.0] - torchvision: [0.9.1, 0.16.0] + torch: [1.8.1] + torchvision: [0.9.1] include: - - python-version: 3.8 - platform: cu117 - torch: 2.0.0 - torchvision: 0.15.1 - python-version: 3.8 platform: cu118 torch: 2.1.0 @@ -318,4 +312,4 @@ jobs: - name: Run GPU unittests # Skip testing distributed related unit tests since the memory of windows CI is limited run: pytest tests/ --ignore tests/test_dist --ignore tests/test_optim/test_optimizer/test_optimizer_wrapper.py --ignore tests/test_model/test_wrappers/test_model_wrapper.py - if: ${{ matrix.platform == 'cu111' }} + if: ${{ matrix.platform == 'cu111' }} || ${{ matrix.platform == 'cu118' }} diff --git a/.github/workflows/pr_stage_test.yml b/.github/workflows/pr_stage_test.yml index a3582932ab..b2576cfd57 100644 --- a/.github/workflows/pr_stage_test.yml +++ b/.github/workflows/pr_stage_test.yml @@ -136,8 +136,10 @@ jobs: runs-on: windows-2022 strategy: matrix: - torch: [2.1.0] - torchvision: [0.16.0] + python-version: [3.7] + platform: [cpu, cu111] + torch: [1.8.1] + torchvision: [0.9.1] include: - python-version: 3.8 platform: cu118 @@ -167,4 +169,4 @@ jobs: - name: Run GPU unittests # Skip testing distributed related unit tests since the memory of windows CI is limited run: pytest tests/ --ignore tests/test_dist --ignore tests/test_optim/test_optimizer/test_optimizer_wrapper.py --ignore tests/test_model/test_wrappers/test_model_wrapper.py --ignore tests/test_hooks/test_sync_buffers_hook.py - if: ${{ matrix.platform == 'cu111' }} + if: ${{ matrix.platform == 'cu111' }} || ${{ matrix.platform == 'cu118' }} diff --git a/requirements/tests.txt b/requirements/tests.txt index 544ddba9d9..94ee153fa3 100644 --- a/requirements/tests.txt +++ b/requirements/tests.txt @@ -7,7 +7,6 @@ dvclive lion-pytorch lmdb mlflow -neptune parameterized pydantic==1.10.9 pytest diff --git a/tests/test_visualizer/test_vis_backend.py b/tests/test_visualizer/test_vis_backend.py index 2f9f665a1e..59d87480c7 100644 --- a/tests/test_visualizer/test_vis_backend.py +++ b/tests/test_visualizer/test_vis_backend.py @@ -13,7 +13,7 @@ from mmengine import Config from mmengine.fileio import load from mmengine.registry import VISBACKENDS -from mmengine.utils import digit_version +from mmengine.utils import digit_version, is_installed from mmengine.visualization import (AimVisBackend, ClearMLVisBackend, DVCLiveVisBackend, LocalVisBackend, MLflowVisBackend, NeptuneVisBackend, @@ -358,6 +358,8 @@ def test_close(self): clearml_vis_backend.close() +@pytest.mark.skipif( + not is_installed('neptune'), reason='Neptune is not installed.') class TestNeptuneVisBackend: def test_init(self):