Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion tests/orchestrator/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@
import pytest

# Add project root to path
sys.path.insert(0, str(Path(__file__).parent.parent.parent))
_PROJECT_ROOT = Path(__file__).parent.parent.parent
sys.path.insert(0, str(_PROJECT_ROOT))

# run_orchestrator.py was moved out of the project root into _archive/old_runners/
# by the root cleanup in aa41933 ("chore: Clean root, update README, archive old
# scripts"). That commit moved 18 runner scripts but did not update the tests that
# import them, so this conftest - and with it the whole pytest session - failed to
# collect. Keep the archived location importable so these tests keep running.
sys.path.insert(0, str(_PROJECT_ROOT / "_archive" / "old_runners"))

from run_orchestrator import OrchestratorConfig, PhaseResult

Expand Down
3 changes: 3 additions & 0 deletions tests/orchestrator/test_fail_forward_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ def make_orchestrator(max_parallel: int = 1) -> EpicOrchestrator:
orch.task_executor.execute_task = AsyncMock(
return_value=TaskExecutionResult(success=True, output="OK", error=None)
)
# See test_pipeline_executor.make_orchestrator: __init__ is bypassed here, so the
# real __init__'s self.db_sync = None default has to be mirrored explicitly.
orch.db_sync = None
return orch


Expand Down
5 changes: 5 additions & 0 deletions tests/orchestrator/test_pipeline_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ def make_orchestrator(max_parallel: int = 3) -> EpicOrchestrator:
orch.task_executor = MagicMock()
orch.task_executor.execute_task = AsyncMock(return_value=make_success_result())
orch._convergence_ran_diff = False # Phase 28
# This helper bypasses __init__, so every attribute the real __init__ sets has to
# be mirrored here. EpicOrchestrator.__init__ sets self.db_sync = None and only
# replaces it when DBTaskSync imports successfully, so None is the faithful
# default: _update_task_status() then skips the live DB write.
orch.db_sync = None
return orch


Expand Down
7 changes: 3 additions & 4 deletions tests/test_code_quality_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
# Add src to path
sys.path.insert(0, str(Path(__file__).parent))

from src.registry import (
DocumentRegistry,
DocumentType,
DocumentStatus,
from src.registry.document_registry import DocumentRegistry
from src.registry.document_types import DocumentType, DocumentStatus
from src.registry.documents import (
QualityReport,
TestSpec,
TestResults,
Expand Down
7 changes: 3 additions & 4 deletions tests/test_document_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
# Add src to path
sys.path.insert(0, str(Path(__file__).parent))

from src.registry import (
DocumentRegistry,
DocumentType,
DocumentStatus,
from src.registry.document_registry import DocumentRegistry
from src.registry.document_types import DocumentType, DocumentStatus
from src.registry.documents import (
DebugReport,
ImplementationPlan,
TestSpec,
Expand Down
6 changes: 4 additions & 2 deletions tests/test_pipeline_data_bucketer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
import sys
import unittest

sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "src"))
# Put the project root on sys.path, not src/ itself: src/secrets.py shadows the
# stdlib secrets module for the rest of the pytest session once src/ is on the path.
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))

from services.pipeline_data_bucketer import PipelineDataBucketer, PipelineDataBucketerState
from src.services.pipeline_data_bucketer import PipelineDataBucketer, PipelineDataBucketerState


class TestBasic(unittest.TestCase):
Expand Down
6 changes: 4 additions & 2 deletions tests/test_pipeline_data_sequencer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
import sys
import unittest

sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "src"))
# Put the project root on sys.path, not src/ itself: src/secrets.py shadows the
# stdlib secrets module for the rest of the pytest session once src/ is on the path.
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))

from services.pipeline_data_sequencer import PipelineDataSequencer
from src.services.pipeline_data_sequencer import PipelineDataSequencer


class TestBasic(unittest.TestCase):
Expand Down
Loading