Skip to content

Add automated tests#14

Merged
andrewbelcher merged 1 commit into
mainfrom
add-automated-tests
Jun 23, 2026
Merged

Add automated tests#14
andrewbelcher merged 1 commit into
mainfrom
add-automated-tests

Conversation

@andrewbelcher

@andrewbelcher andrewbelcher commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

The Issue

Automated tests are critical to the trustworthiness of any DDEV add-on. This PR adds a test suite and the standard add-on maintenance scaffolding recommended by the DDEV add-on maintenance guide.

How This PR Solves The Issue

  • tests/test.bats — Bats suite with two tests: install from directory (local working copy) and install from release (release-tagged, CI/scheduled only). Each installs the add-on, restarts, and asserts:
    • The add-on installs with no failed post-start hooks (refute_hook_failure catches the silently-broken-hook class of bug, since DDEV logs hook failures but still exits 0).
    • ddev claude --version runs — the binary is installed and on PATH.
    • Config is handled correctly, verified through Claude's own behavior rather than by inspecting symlinks:
      • Host → container: a host-seeded MCP server is detected live by ddev claude mcp get (no restart needed — the symlink is live).
      • Container → host: a server added via ddev claude mcp add -s user round-trips back into the persisted host config (also guards against Claude's atomic write detaching the symlink).
  • .github/workflows/tests.yml — runs the suite on PRs, pushes to main, a daily schedule, and manual dispatch, against both stable and HEAD DDEV via ddev/github-action-add-on-test@v2.
  • Hygiene files.gitattributes (release export-ignore), CONTRIBUTING.md, issue/PR templates, and ddev_version_constraint: '>= v1.24.3' in install.yaml.

Manual Testing Instructions

ddev add-on get https://github.com/FreelyGive/ddev-claude-code/tarball/refs/pull/14/head
ddev restart

Or run the suite locally (excluding the release test):

bats ./tests/test.bats --filter-tags '!release'

Automated Testing Overview

This PR introduces the automated tests described above. The install from directory test passes locally end-to-end.

Release/Deployment Notes

ddev_version_constraint: '>= v1.24.3' is now enforced at install time.

🤖 Generated with Claude Code

Adds a Bats test suite and CI per the DDEV add-on maintenance guide,
addressing issue #10.

tests/test.bats covers install-from-directory and install-from-release
(release-tagged). Beyond installing cleanly with no failed post-start
hooks, it verifies config handling through Claude Code's own behavior
rather than by inspecting symlinks: a host-seeded MCP server is detected
live by `ddev claude mcp get` (no restart), and a server added via
`ddev claude mcp add` round-trips back into the persisted host config.

Also adds the standard add-on hygiene files: tests.yml CI workflow
(stable + HEAD matrix), .gitattributes release export-ignore,
CONTRIBUTING.md, issue/PR templates, and a ddev_version_constraint.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@andrewbelcher andrewbelcher merged commit dbe0b75 into main Jun 23, 2026
2 checks passed
@andrewbelcher andrewbelcher deleted the add-automated-tests branch June 23, 2026 16:11
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.

Please add automated tests

1 participant