Skip to content

Commit 00cacbc

Browse files
committed
Fix tests.
1 parent 9a4326a commit 00cacbc

File tree

3 files changed

+22
-18
lines changed

3 files changed

+22
-18
lines changed

.github/workflows/ci-python.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ jobs:
6363
cd ${{ github.workspace }}/apps
6464
uv run pyright
6565
66-
- name: Run tests (pytest) for bfd-pipeline-idr
66+
- name: Run tests (pytest)
6767
run: |
6868
cd ${{ github.workspace }}/apps
69-
uv run pytest bfd-pipeline/bfd-pipeline-idr
69+
uv run pytest
7070
7171
non-workspace-checks:
7272
name: Non-Workspace Project - sftp-outbound-transfer

apps/bfd-pipeline/bfd-pipeline-idr/pipeline.py

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import os
33
import sys
44
import time
5-
from pathlib import Path
65

76
import pipeline_nodes
87
import ray
@@ -28,20 +27,26 @@ def main() -> None:
2827
logger.info("load start")
2928

3029
parallelism = int(os.environ.get("PARALLELISM", "6"))
31-
# Shutdown any existing Ray instance first to avoid conflicts.
32-
if ray.is_initialized(): # type: ignore
33-
ray.shutdown() # type: ignore
34-
time.sleep(1)
35-
ray.init(
36-
logging_level="info",
37-
num_cpus=parallelism,
38-
local_mode=True, # Run tasks inprocess to avoid worker version mismatches
39-
ignore_reinit_error=True,
40-
runtime_env=None,
41-
) # type: ignore
42-
43-
dict_builder = base.DictResult()
44-
adapter = RayGraphAdapter(result_builder=dict_builder)
30+
mode = sys.argv[1] if len(sys.argv) > 1 else ""
31+
use_ray = mode not in ("synthetic", "local")
32+
33+
if use_ray:
34+
# Shutdown any existing Ray instance first to avoid conflicts.
35+
if ray.is_initialized():
36+
ray.shutdown()
37+
time.sleep(1)
38+
39+
ray.init(
40+
logging_level="info",
41+
num_cpus=parallelism,
42+
)
43+
dict_builder = base.DictResult()
44+
adapter = RayGraphAdapter(result_builder=dict_builder)
45+
else:
46+
# Use simple non distributed adapter for tests
47+
dict_builder = base.DictResult()
48+
adapter = base.SimplePythonGraphAdapter(result_builder=dict_builder)
49+
4550
load_type = str(os.environ.get("LOAD_TYPE", "incremental"))
4651
logger.info("load_type %s", load_type)
4752
dr = (

apps/pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,4 @@ reportMissingTypeStubs = false
9090

9191
[tool.pytest.ini_options]
9292
timeout = 600
93-
testpaths = ["bfd-pipeline/bfd-pipeline-idr"]
9493

0 commit comments

Comments
 (0)