Skip to content

Add hc_agent smoke tests and minimal helpers - #34

Draft
binrogithub wants to merge 1 commit into
masterfrom
codex/create-smoke-tests-for-hc-agent
Draft

Add hc_agent smoke tests and minimal helpers#34
binrogithub wants to merge 1 commit into
masterfrom
codex/create-smoke-tests-for-hc-agent

Conversation

@binrogithub

Copy link
Copy Markdown
Owner

Motivation

  • Provide a small, testable hc-agent surface so smoke tests can validate preview/apply flows and run artifact wiring.
  • Ensure preview code path never issues network calls and apply triggers exactly one outbound request.
  • Verify gateway/runstore wiring writes run artifacts to runs/<run_id>/report.md so downstream tooling can consume reports.

Description

  • Add hc_agent.py implementing preview(payload), apply(payload, request_fn=None), a RunStore helper that writes report.md, and gateway_run(...) which creates a run and writes a report.
  • Add pytest smoke tests in tests/test_hc_agent_smoke.py that use monkeypatch/unittest.mock and a FakeResponse to exercise the three scenarios required: preview does not call requests.request, apply calls requests.request exactly once, and gateway run writes runs/<run_id>/report.md under a provided runstore root.
  • Tests patch hc_agent.requests.request to avoid real network I/O and use tmp_path to isolate filesystem writes.

Testing

  • No automated tests were executed as part of this change; the commit adds tests/test_hc_agent_smoke.py which is pytest-compatible and ready to run locally or in CI.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant