Skip to content

Commit bda94b2

Browse files
fix: skip cross-DSL integration tests when DSL packages unavailable
Adds pytestmark skipif guard so CI per-package jobs (e.g. --package gds-framework) don't fail on missing stockflow/control/games/software/ business imports. Also fixes stale Shipment field names (source_node → source, target_node → target).
1 parent 85c40b3 commit bda94b2

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

packages/gds-framework/tests/test_cross_dsl_integration.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,29 @@
55
produces valid SystemIR, passes verification, and yields correct canonical
66
h = f . g decomposition.
77
8+
These tests require all DSL packages to be installed. When run in isolation
9+
(e.g. ``--package gds-framework``), the entire module is skipped.
10+
811
Run with:
912
uv run pytest packages/gds-framework/tests/test_cross_dsl_integration.py -v
1013
"""
1114

15+
import importlib
16+
1217
import pytest
1318

1419
from gds.canonical import project_canonical
1520
from gds.ir.models import SystemIR
1621
from gds.spec import GDSSpec
1722

23+
# Skip entire module if any DSL package is missing (CI runs per-package)
24+
_REQUIRED = ["stockflow", "gds_control", "ogs", "gds_software", "gds_business"]
25+
_missing = [m for m in _REQUIRED if importlib.util.find_spec(m) is None]
26+
pytestmark = pytest.mark.skipif(
27+
len(_missing) > 0,
28+
reason=f"Cross-DSL tests require all DSL packages; missing: {_missing}",
29+
)
30+
1831
# ════════════════════════════════════════════════════════════════
1932
# StockFlow DSL
2033
# ════════════════════════════════════════════════════════════════
@@ -117,7 +130,6 @@ def test_spec_validates(self, minimal_model):
117130
# Control DSL
118131
# ════════════════════════════════════════════════════════════════
119132

120-
121133
class TestControlRoundTrip:
122134
"""Control: declare → compile → verify → canonical."""
123135

@@ -213,7 +225,6 @@ def test_spec_validates(self, minimal_model):
213225
# OGS (Games) DSL
214226
# ════════════════════════════════════════════════════════════════
215227

216-
217228
class TestOGSRoundTrip:
218229
"""OGS: Pattern → compile_pattern_to_spec → canonical."""
219230

@@ -317,7 +328,6 @@ def test_pattern_ir_to_system_ir(self, single_decision):
317328
# Software DSL
318329
# ════════════════════════════════════════════════════════════════
319330

320-
321331
class TestSoftwareRoundTrip:
322332
"""Software: each diagram type compiles through GDS pipeline."""
323333

@@ -411,7 +421,6 @@ def test_dfd_verify(self, dfd_model):
411421
# Business DSL
412422
# ════════════════════════════════════════════════════════════════
413423

414-
415424
class TestBusinessRoundTrip:
416425
"""Business: CLD, SCN, VSM compile through GDS pipeline."""
417426

@@ -446,10 +455,10 @@ def scn_model(self):
446455
SupplyNode(name="Retailer"),
447456
],
448457
shipments=[
449-
Shipment(name="F->R", source_node="Factory", target_node="Retailer"),
458+
Shipment(name="F->R", source="Factory", target="Retailer"),
450459
],
451460
demand_sources=[
452-
DemandSource(name="Customer", target_node="Retailer"),
461+
DemandSource(name="Customer", target="Retailer"),
453462
],
454463
order_policies=[
455464
OrderPolicy(name="Reorder", node="Retailer", inputs=["Retailer"]),

0 commit comments

Comments
 (0)