mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-02-09 06:15:41 -05:00
fix(mcp): Skip e2e tests in CI unless --run-e2e is passed
E2e tests hit a real external MCP server and are inherently flaky. Skip them by default, require --run-e2e flag to opt in.
This commit is contained in:
@@ -9,6 +9,27 @@ full SpinTestServer infrastructure.
|
||||
import pytest
|
||||
|
||||
|
||||
def pytest_configure(config: pytest.Config) -> None:
|
||||
config.addinivalue_line("markers", "e2e: end-to-end tests requiring network")
|
||||
|
||||
|
||||
def pytest_collection_modifyitems(
|
||||
config: pytest.Config, items: list[pytest.Item]
|
||||
) -> None:
|
||||
"""Skip e2e tests unless --run-e2e is passed."""
|
||||
if not config.getoption("--run-e2e", default=False):
|
||||
skip_e2e = pytest.mark.skip(reason="need --run-e2e option to run")
|
||||
for item in items:
|
||||
if "e2e" in item.keywords:
|
||||
item.add_marker(skip_e2e)
|
||||
|
||||
|
||||
def pytest_addoption(parser: pytest.Parser) -> None:
|
||||
parser.addoption(
|
||||
"--run-e2e", action="store_true", default=False, help="run e2e tests"
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def server():
|
||||
"""No-op override — MCP tests don't need the full platform server."""
|
||||
|
||||
Reference in New Issue
Block a user