Skip to content

test: add end-to-end integration suite, guards, and manual test script (ENG-384) - #7

Merged
folathecoder merged 1 commit into
mainfrom
folathecoder/eng-384-8-testing-automated-and-manual
Oct 18, 2026
Merged

folathecoder merged 1 commit into
mainfrom
folathecoder/eng-384-8-testing-automated-and-manual

Conversation

@folathecoder

Copy link
Copy Markdown
Contributor

Summary

Completes the automated and manual testing infrastructure for Aldwin 0.0.1. Every test now runs inside an autouse temporary ALDWIN_HOME and HOME with outbound AF_INET/AF_INET6 sockets blocked by default, backed by shared FakeModel, FakeHost, agent_session, and host_client fixtures, a full integration suite, a dedicated CLI rendering suite, AST architecture guards, CI coverage artifact upload, and the clean-machine manual test script in docs/manual-test.md.

Ticket

Closes ENG-384

Changes

  • Fixtures and isolation (tests/conftest.py, tests/fakes/model.py, tests/fakes/host.py, tests/test_conftest_guards.py):
    • Made aldwin_home autouse=True (redirects ALDWIN_HOME and HOME into tmp_path, clears OPENAI_API_KEY and TAVILY_API_KEY in non-live runs, and initializes ensure_home() unless marked @pytest.mark.uninitialized_home).
    • Added no_network (autouse=True) blocking outbound AF_INET and AF_INET6 sockets while permitting AF_UNIX socket.socketpair() for asyncio and prompt_toolkit.
    • Added agent_session, host_client, fake_host, collect, and auto_approve fixtures/helpers, plus top-level FakeModel turn builders (text(..., deltas=N), tool_call, final, raise_, hang) and FakeHost.requests tracking.
  • Integration suite (tests/integration/test_full_turns.py):
    • Added end-to-end tests through AldwinClient -> AldwinHost -> aldwin.core covering 5-delta streaming, run_command approval (yes and no), Esc stop during stream and during approval (< 1 s), model error handling, max_steps=15, crash after step 2 followed by reload and "continue", /new, and a 50-turn conversation verifying <= 20 user turns per model call and 1 terminal event per turn.
  • CLI rendering suite and architecture guards (tests/cli/test_render_suite.py, tests/test_architecture.py):
    • Added tests/cli/test_render_suite.py covering welcome/header, dimmed history and divider, streamed markdown with code fences, exact tool cards (✓ and ✗), approval panel, end and stopped lines, all 6 ErrorCode messages, plain mode (\x1b[ and \a absent), and unknown slash command handling.
    • Upgraded tests/test_architecture.py with AST + text import verification (check_forbidden_imports), builtin_tools() 6-name verification, deliberate bad-import detection, CI matrix/artifact assertions, and docs/manual-test.md completeness checks.
  • Live checks, CI, and manual script (tests/live/test_openai_live.py, .github/workflows/ci.yml, docs/manual-test.md):
    • Added @pytest.mark.live test_tavily_live_search.
    • Configured .github/workflows/ci.yml to generate and upload coverage.xml via actions/upload-artifact@v4.
    • Added docs/manual-test.md with clean-machine setup instructions for macOS and Linux, the 13-step verification script, and the platform test log template.

How it was tested

  • Automated checks:
    • uv run ruff check src tests (passed)
    • uv run ruff format --check src tests (69 files formatted)
    • uv run mypy src tests (passed, 65 source files)
    • uv run pytest --cov=aldwin --cov-report=term-missing --cov-fail-under=90 (233 passed, 2 deselected in 3.71s, 92.43% total coverage; protocol/ 100%, host/ 95-96%, core/tools/ 92-100%, core/memory.py 95%)
    • OPENAI_API_KEY="" TAVILY_API_KEY="" uv run pytest -m live -v (2 skipped)

Notes for reviewers

  • Clean-machine manual test runs on macOS and Linux (docs/manual-test.md section 3) will be executed and logged on ENG-384 as part of pre-release verification (ENG-385).

…t (ENG-384)

Make aldwin_home and no_network autouse fixtures in tests/conftest.py, add shared host_client, agent_session, fake_host, collect, and auto_approve helpers, and expand FakeModel with top-level turn builders. Add the full integration suite (tests/integration/test_full_turns.py), CLI rendering suite (tests/cli/test_render_suite.py), AST import guards, live Tavily check, CI coverage upload, and docs/manual-test.md.
@folathecoder
folathecoder merged commit 5b091b7 into main Oct 18, 2026
4 checks passed
@folathecoder
folathecoder deleted the folathecoder/eng-384-8-testing-automated-and-manual branch October 18, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant