Skip to content

Add end-to-end executor integration tests and shared db fixture#59

Merged
seanwevans merged 1 commit into
mainfrom
claude/executor-integration-tests
Jun 27, 2026
Merged

Add end-to-end executor integration tests and shared db fixture#59
seanwevans merged 1 commit into
mainfrom
claude/executor-integration-tests

Conversation

@seanwevans

Copy link
Copy Markdown
Owner

Summary

The executor's database helpers — fetch_pending, update_command,
update_cwd — were only covered indirectly (the unit tests stub them out).
This adds real database-backed tests that drive a command through the full
executor path and verify the persisted result.

New tests (tests/test_executor_integration.py)

  • End-to-end run — submit a command, claim it with fetch_pending (verifying
    it flips to running), execute it via handle_command, then assert the
    commands row is done with the captured output, exit_code = 0, and
    completed_at populated.
  • cd updates environment — run cd workdir and assert the environments
    row's cwd is updated to the new directory.
  • Idle pollfetch_pending returns None when there is no pending work.

Infrastructure

  • Added tests/conftest.py with a reusable db_conn fixture and
    install_schema helper, so test modules no longer have to reimplement schema
    setup. (Existing modules keep their current fixtures; they can migrate to the
    shared one in a later cleanup.)

Verification

  • Against a live Postgres 16: 38 passed (3 new).
  • Without a database: 25 passed, 13 skipped — new tests skip gracefully.

🤖 Generated with Claude Code


Generated by Claude Code

The executor's database helpers (fetch_pending, update_command,
update_cwd) were only covered indirectly via stubs. Add real
database-backed tests that:

- submit a command, claim it with fetch_pending, run it through
  handle_command, and assert the commands row is marked done with output,
  exit code, and completed_at populated;
- run a `cd` command and assert the environments row is updated;
- assert fetch_pending returns None when there is no pending work.

Introduce tests/conftest.py with a reusable db_conn fixture and
install_schema helper so modules no longer reimplement schema setup.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BixPb34oe2Ae5cXuz9WxbP
@seanwevans
seanwevans merged commit 1edf9e2 into main Jun 27, 2026
2 checks passed
@seanwevans
seanwevans deleted the claude/executor-integration-tests branch June 27, 2026 00:51
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.

2 participants