Skip to content

test: add e2e tests for prompts functionality#306

Merged
peterj merged 2 commits intoagentregistry-dev:mainfrom
optimus-fulcria:fix/233-prompt-e2e-tests
Mar 10, 2026
Merged

test: add e2e tests for prompts functionality#306
peterj merged 2 commits intoagentregistry-dev:mainfrom
optimus-fulcria:fix/233-prompt-e2e-tests

Conversation

@optimus-fulcria
Copy link
Copy Markdown
Contributor

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 survives
  • TestPromptContentIntegrity - round-trip publish/retrieve verifying exact content and description match
  • TestPromptShowNonExistent - show a prompt that doesn't exist
  • TestPromptDeleteNonExistent - delete a prompt that doesn't exist (expects failure)
  • TestPromptAPINotFound - direct API 404 checks for nonexistent prompts and nonexistent versions of existing prompts
  • TestPromptPublishYAMLWithFlagOverrides - verify CLI flags (--name, --description) override YAML values
  • TestPromptDryRunDoesNotCreate - verify --dry-run does not persist the prompt (API returns 404 after)
  • TestPromptListOutputJSON - verify --output json produces valid JSON
  • TestPromptDeleteThenShowReturnsNotFound - publish, delete, then verify 404 via API
  • TestPromptPublishValidation/directory_instead_of_file - pass a directory path instead of file

Existing tests preserved unchanged:

  • TestPromptPublishListShowDelete (full lifecycle)
  • TestPromptPublishYAML
  • TestPromptPublishDryRun
  • TestPromptPublishValidation (missing_name, missing_version, nonexistent_file)
  • TestPromptDeleteValidation (missing_version_flag)

Change Type

/kind feature

Changelog

Add comprehensive e2e tests for prompts: multi-version workflows, API verification, content integrity, error cases, and edge cases.

Additional Notes

All new tests follow existing e2e patterns (build tag, helper functions, unique names, cleanup). Verified compilation with go vet -tags e2e ./e2e/....

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]>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 7, 2026

You already have 3 pull requests open. Please consider working on getting the existing ones merged before opening new ones. Thanks!

Copy link
Copy Markdown
Collaborator

@inFocus7 inFocus7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 peterj added this pull request to the merge queue Mar 10, 2026
Merged via the queue into agentregistry-dev:main with commit 7f72fba Mar 10, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

write e2e tests for prompts functionality

3 participants