Skip to content

Commit

Permalink
skip test_structure_optimizer_passes_kwargs_to_model in macos CI
Browse files Browse the repository at this point in the history
  • Loading branch information
janosh committed Feb 8, 2024
1 parent a70ac0e commit 56300fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
pip install -e .[test]
- name: Run Tests
run: PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.0 pytest --capture=no --cov --cov-report=xml .
run: pytest --capture=no --cov --cov-report=xml .

- name: Codacy coverage reporter
if: ${{ matrix.os == 'ubuntu-latest' && github.event_name == 'push' }}
Expand Down
9 changes: 7 additions & 2 deletions tests/test_relaxation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import os
import re
from typing import TYPE_CHECKING, Literal

Expand Down Expand Up @@ -44,12 +45,16 @@ def test_relaxation(


no_cuda = mark.skipif(not torch.cuda.is_available(), reason="No CUDA device")
no_mps = mark.skipif(not torch.backends.mps.is_available(), reason="No MPS device")
# skip in macos-14 M1 CI due to OOM error (TODO investigate if
# PYTORCH_MPS_HIGH_WATERMARK_RATIO can fix)
no_mps = mark.skipif(
not torch.backends.mps.is_available() or "CI" in os.environ, reason="No MPS device"
)


@mark.parametrize(
"use_device", ["cpu", param("cuda", marks=no_cuda), param("mps", marks=no_mps)]
)
def test_structure_optimizer_passes_kwargs_to_model(use_device) -> None:
def test_structure_optimizer_passes_kwargs_to_model(use_device: str) -> None:
relaxer = StructOptimizer(use_device=use_device)
assert re.match(rf"{use_device}(:\d+)?", relaxer.calculator.device)

0 comments on commit 56300fe

Please sign in to comment.