Skip to content

Commit

Permalink
test sequential ipex/openvino
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasMoutawwakil committed Dec 9, 2024
1 parent 214c69f commit dc8adf7
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test_cli_cpu_ipex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ jobs:
run: |
pip install -e .[testing,ipex,diffusers,timm]
- name: Run tests
run: pytest tests/test_cli.py -s -k "cli and cpu and ipex"
- name: Run tests (sequential)
run: FORCE_SEQUENTIAL=1 pytest tests/test_cli.py -s -k "cli and cpu and ipex"

- name: Run examples
run: pytest tests/test_examples.py -s -k "cli and cpu and ipex"
- name: Run examples (sequential)
run: FORCE_SEQUENTIAL=1 pytest tests/test_examples.py -s -k "cli and cpu and ipex"
8 changes: 4 additions & 4 deletions .github/workflows/test_cli_cpu_openvino.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ jobs:
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
pip install -e .[testing,openvino,diffusers,timm]
- name: Run tests
run: pytest tests/test_cli.py -s -k "cli and cpu and openvino"
- name: Run tests (sequential)
run: FORCE_SEQUENTIAL=1 pytest tests/test_cli.py -s -k "cli and cpu and openvino"

- name: Run examples
run: pytest tests/test_examples.py -s -k "cli and cpu and openvino"
- name: Run examples (sequential)
run: FORCE_SEQUENTIAL=1 pytest tests/test_examples.py -s -k "cli and cpu and openvino"
2 changes: 1 addition & 1 deletion .github/workflows/test_energy_star.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}

jobs:
run_energy_star_tests:
run_energy_star:
if: ${{
(github.event_name == 'push') ||
(github.event_name == 'workflow_dispatch') ||
Expand Down
9 changes: 9 additions & 0 deletions tests/test_energy_star.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
for config in os.listdir(TEST_CONFIG_DIR)
if config.endswith(".yaml") and not (config.startswith("_") or config.endswith("_"))
]
TEST_SCRIPT_PATHS = [TEST_CONFIG_DIR / filename for filename in os.listdir(TEST_CONFIG_DIR) if filename.endswith(".py")]

ROCR_VISIBLE_DEVICES = os.environ.get("ROCR_VISIBLE_DEVICES", None)
CUDA_VISIBLE_DEVICES = os.environ.get("CUDA_VISIBLE_DEVICES", None)
Expand Down Expand Up @@ -43,3 +44,11 @@ def test_cli_configs(config_name):

popen = run_subprocess_and_log_stream_output(LOGGER, args)
assert popen.returncode == 0, f"Failed to run {config_name}"


@pytest.mark.parametrize("script_path", TEST_SCRIPT_PATHS)
def test_api_scripts(script_path):
args = ["python", script_path]

popen = run_subprocess_and_log_stream_output(LOGGER, args)
assert popen.returncode == 0, f"Failed to run {script_path}"
5 changes: 0 additions & 5 deletions tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,5 @@ def test_cli_configs(config_name):
def test_api_scripts(script_path):
args = ["python", script_path]

if ROCR_VISIBLE_DEVICES is not None:
args += [f'backend.device_ids="{ROCR_VISIBLE_DEVICES}"']
elif CUDA_VISIBLE_DEVICES is not None:
args += [f'backend.device_ids="{CUDA_VISIBLE_DEVICES}"']

popen = run_subprocess_and_log_stream_output(LOGGER, args)
assert popen.returncode == 0, f"Failed to run {script_path}"

0 comments on commit dc8adf7

Please sign in to comment.