Add automated tests#14
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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) andinstall from release(release-tagged, CI/scheduled only). Each installs the add-on, restarts, and asserts:refute_hook_failurecatches the silently-broken-hook class of bug, since DDEV logs hook failures but still exits 0).ddev claude --versionruns — the binary is installed and on PATH.ddev claude mcp get(no restart needed — the symlink is live).ddev claude mcp add -s userround-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 tomain, a daily schedule, and manual dispatch, against bothstableandHEADDDEV viaddev/github-action-add-on-test@v2..gitattributes(releaseexport-ignore),CONTRIBUTING.md, issue/PR templates, andddev_version_constraint: '>= v1.24.3'ininstall.yaml.Manual Testing Instructions
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 directorytest passes locally end-to-end.Release/Deployment Notes
ddev_version_constraint: '>= v1.24.3'is now enforced at install time.🤖 Generated with Claude Code