From cc00efc4c1c385d2e271516f2584c79c2cf375d8 Mon Sep 17 00:00:00 2001 From: nathan Date: Mon, 13 Apr 2026 13:22:00 -0400 Subject: [PATCH] fix(ci): resolve test collection and async failures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add conftest.py to inject lib/ onto sys.path, fixing ModuleNotFoundError on identity test collection - Add pytest-asyncio to CI install step and pyproject.toml test extras; set asyncio_mode=auto to resolve 31 async test failures flagged in session tech debt backlog - All 35 tests now pass; 8 skipped (live API, expected) Ref: Session Snapshot 2026-04-13 — "Pytest validation incomplete" --- .github/workflows/nexus-mcp-ci.yml | 2 +- nexus-mcp/conftest.py | 9 +++++++++ nexus-mcp/pyproject.toml | 10 ++++++++++ nexus-mcp/src/nexus_mcp.egg-info/SOURCES.txt | 1 + 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 nexus-mcp/conftest.py diff --git a/.github/workflows/nexus-mcp-ci.yml b/.github/workflows/nexus-mcp-ci.yml index 205d2d3..6aadeba 100644 --- a/.github/workflows/nexus-mcp-ci.yml +++ b/.github/workflows/nexus-mcp-ci.yml @@ -37,7 +37,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -e . - pip install pytest pytest-cov black ruff + pip install pytest pytest-cov pytest-asyncio black ruff - name: Lint with ruff working-directory: nexus-mcp diff --git a/nexus-mcp/conftest.py b/nexus-mcp/conftest.py new file mode 100644 index 0000000..cb5ebe2 --- /dev/null +++ b/nexus-mcp/conftest.py @@ -0,0 +1,9 @@ +""" +Root conftest.py — adds lib/ to sys.path so legacy identity tests can import +adapters directly (e.g. `from ad_adapter import ...`) without package prefix. +""" +import sys +from pathlib import Path + +# Allow bare imports like `from ad_adapter import ...` used by identity_tests/ +sys.path.insert(0, str(Path(__file__).parent / "lib")) diff --git a/nexus-mcp/pyproject.toml b/nexus-mcp/pyproject.toml index dd53a79..81c8b18 100644 --- a/nexus-mcp/pyproject.toml +++ b/nexus-mcp/pyproject.toml @@ -26,8 +26,18 @@ dependencies = [ [project.scripts] nexus-mcp = "main:main" +[project.optional-dependencies] +test = [ + "pytest>=8.0.0", + "pytest-cov>=5.0.0", + "pytest-asyncio>=0.24.0", +] + [tool.setuptools.packages.find] where = ["src"] [tool.setuptools.package-dir] "" = "src" + +[tool.pytest.ini_options] +asyncio_mode = "auto" diff --git a/nexus-mcp/src/nexus_mcp.egg-info/SOURCES.txt b/nexus-mcp/src/nexus_mcp.egg-info/SOURCES.txt index 9cda837..2ec2f54 100644 --- a/nexus-mcp/src/nexus_mcp.egg-info/SOURCES.txt +++ b/nexus-mcp/src/nexus_mcp.egg-info/SOURCES.txt @@ -9,6 +9,7 @@ src/nexus_mcp.egg-info/top_level.txt src/shards/__init__.py src/shards/assets.py src/shards/audit.py +src/shards/audit_minimal.py src/shards/identity.py src/shards/itsm.py src/shards/logistics.py