test: add e2e tests for prompts functionality#306
Merged
peterj merged 2 commits intoagentregistry-dev:mainfrom Mar 10, 2026
Merged
test: add e2e tests for prompts functionality#306peterj merged 2 commits intoagentregistry-dev:mainfrom
peterj merged 2 commits intoagentregistry-dev:mainfrom
Conversation
Expand prompt e2e test coverage with new test cases: - Multi-version publish, retrieve, and delete workflows - API-level verification of prompt content and metadata - Content integrity checks (round-trip publish/retrieve) - Latest version resolution via API - Version listing endpoint verification - Error cases: show/delete non-existent prompts, 404 responses - YAML flag override behavior - Dry-run verification (prompt not persisted) - JSON output format validation for list command - Delete-then-verify-gone workflow - Directory-instead-of-file validation Closes agentregistry-dev#233 Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
You already have 3 pull requests open. Please consider working on getting the existing ones merged before opening new ones. Thanks! |
inFocus7
reviewed
Mar 9, 2026
Collaborator
inFocus7
left a comment
There was a problem hiding this comment.
minor nits, but overall lgtm! the ones 100% worth adding imo are the RequireOutputContains(t, result, v2) & versionsResp.Metadata.Count != 2 checks, the other request would just be nice for deduplication efforts.
Signed-off-by: Fabian Gonzalez <[email protected]>
peterj
approved these changes
Mar 10, 2026
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.
Description
Add comprehensive e2e tests for the prompts functionality, covering the full prompt lifecycle and edge cases.
Closes #233
New test cases added:
TestPromptMultipleVersions- publish v1 and v2, verify both via API, check latest resolution, list all versions, delete v1 and confirm v2 survivesTestPromptContentIntegrity- round-trip publish/retrieve verifying exact content and description matchTestPromptShowNonExistent- show a prompt that doesn't existTestPromptDeleteNonExistent- delete a prompt that doesn't exist (expects failure)TestPromptAPINotFound- direct API 404 checks for nonexistent prompts and nonexistent versions of existing promptsTestPromptPublishYAMLWithFlagOverrides- verify CLI flags (--name, --description) override YAML valuesTestPromptDryRunDoesNotCreate- verify --dry-run does not persist the prompt (API returns 404 after)TestPromptListOutputJSON- verify --output json produces valid JSONTestPromptDeleteThenShowReturnsNotFound- publish, delete, then verify 404 via APITestPromptPublishValidation/directory_instead_of_file- pass a directory path instead of fileExisting tests preserved unchanged:
TestPromptPublishListShowDelete(full lifecycle)TestPromptPublishYAMLTestPromptPublishDryRunTestPromptPublishValidation(missing_name, missing_version, nonexistent_file)TestPromptDeleteValidation(missing_version_flag)Change Type
/kind feature
Changelog
Additional Notes
All new tests follow existing e2e patterns (build tag, helper functions, unique names, cleanup). Verified compilation with
go vet -tags e2e ./e2e/....