-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Add /selftest.extension core extension to test other extensions #1758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dhilipkumars
wants to merge
17
commits into
github:main
Choose a base branch
from
dhilipkumars:add-extensions-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
f42af45
test(commands): create extension-commands LLM playground sandbox
dhilipkumars 1dc000b
update(tests): format LLM evaluation as an automated test runner
dhilipkumars c1f47b3
test(commands): map extension-commands python script with timestamps
dhilipkumars 4d09e9b
test(commands): map extension-commands python script with timestamps
dhilipkumars e1e3011
test(commands): update TESTING.md to evaluate discovery, lint, and de…
dhilipkumars e6316fa
test(commands): simplify execution expectations and add timestamp cal…
dhilipkumars 93d9af0
fix(tests): address copilot review comments on prompt formatting and …
dhilipkumars 9fe81a9
fix(tests): resolve copilot PR feedback regarding extension schema st…
dhilipkumars 1777448
feat(extensions): add core selftest utility and migrate away from man…
dhilipkumars 48a0ea0
fix(selftest): update command name array to match spec-kit validation…
dhilipkumars 7dc74c7
fix(selftest): wrap arguments in quotes to support multi-word extensi…
dhilipkumars 5048406
update the command to be more meaningful
dhilipkumars c421117
fix: if the extension is discovery only, it should not be installable
dhilipkumars 11b07a5
Address review comments for selftest documentation
dhilipkumars 32b95e5
address review comments
dhilipkumars 9e718ea
address review comments
dhilipkumars 4247f5b
Update extensions/selftest/commands/selftest.md
mnriem File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,21 @@ | ||
| { | ||
| "schema_version": "1.0", | ||
| "updated_at": "2026-02-03T00:00:00Z", | ||
| "updated_at": "2026-03-10T00:00:00Z", | ||
| "catalog_url": "https://raw.githubusercontent.com/github/spec-kit/main/extensions/catalog.json", | ||
| "extensions": {} | ||
| } | ||
| "extensions": { | ||
| "selftest": { | ||
| "name": "Spec Kit Self-Test Utility", | ||
| "id": "selftest", | ||
| "version": "1.0.0", | ||
dhilipkumars marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "description": "Verifies catalog extensions by programmatically walking through the discovery, installation, and registration lifecycle.", | ||
| "author": "spec-kit-core", | ||
| "repository": "https://github.com/github/spec-kit", | ||
| "download_url": "https://github.com/github/spec-kit/releases/download/selftest-v1.0.0/selftest.zip", | ||
mnriem marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "tags": [ | ||
| "testing", | ||
| "core", | ||
| "utility" | ||
| ] | ||
| } | ||
mnriem marked this conversation as resolved.
Show resolved
Hide resolved
dhilipkumars marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| --- | ||
| description: "Validate the lifecycle of an extension from the catalog." | ||
| --- | ||
|
|
||
| # Extension Self-Test: `$ARGUMENTS` | ||
|
|
||
| This command drives a self-test simulating the developer experience with the `$ARGUMENTS` extension. | ||
|
|
||
| ## Goal | ||
|
|
||
| Validate the end-to-end lifecycle (discovery, installation, registration) for the extension: `$ARGUMENTS`. | ||
| If `$ARGUMENTS` is empty, you must tell the user to provide an extension name, for example: `/speckit.selftest.extension linear`. | ||
|
|
||
| ## Steps | ||
|
|
||
| ### Step 1: Catalog Discovery Validation | ||
|
|
||
| Check if the extension exists in the Spec Kit catalog. | ||
| Execute this command and verify that it completes successfully and that the returned extension ID exactly matches `$ARGUMENTS`. If the command fails or the ID does not match `$ARGUMENTS`, fail the test. | ||
|
|
||
| ```bash | ||
| specify extension info "$ARGUMENTS" | ||
| ``` | ||
|
|
||
| ### Step 2: Simulate Installation | ||
|
|
||
| First, try to add the extension to the current workspace configuration directly. If the catalog provides the extension as `install_allowed: false` (discovery-only), this step is *expected* to fail. | ||
|
|
||
| ```bash | ||
| specify extension add "$ARGUMENTS" | ||
| ``` | ||
mnriem marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Then, simulate adding the extension by installing it from its catalog download URL, which should bypass the restriction. | ||
| Obtain the extension's `download_url` from the catalog metadata (for example, via a catalog info command or UI), then run: | ||
|
|
||
| ```bash | ||
| specify extension add "$ARGUMENTS" --from "<download_url>" | ||
| ``` | ||
dhilipkumars marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ### Step 3: Registration Verification | ||
|
|
||
| Once the `add` command completes, verify the installation by checking the project configuration. | ||
| Use terminal tools (like `cat`) to verify that the following file contains a record for `$ARGUMENTS`. | ||
|
|
||
| ```bash | ||
| cat .specify/extensions/.registry/$ARGUMENTS.json | ||
| ``` | ||
dhilipkumars marked this conversation as resolved.
Show resolved
Hide resolved
dhilipkumars marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ### Step 4: Verification Report | ||
|
|
||
| Analyze the standard output of the three steps. | ||
| Generate a terminal-style test output format detailing the results of discovery, installation, and registration. Return this directly to the user. | ||
|
|
||
| Example output format: | ||
| ```text | ||
| ============================= test session starts ============================== | ||
| collected 3 items | ||
|
|
||
| test_selftest_discovery.py::test_catalog_search [PASS/FAIL] | ||
| Details: [Provide execution result of specify extension search] | ||
mnriem marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| test_selftest_installation.py::test_extension_add [PASS/FAIL] | ||
| Details: [Provide execution result of specify extension add] | ||
|
|
||
| test_selftest_registration.py::test_config_verification [PASS/FAIL] | ||
| Details: [Provide execution result of registry record verification] | ||
|
|
||
| ============================== [X] passed in ... ============================== | ||
| ``` | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| schema_version: "1.0" | ||
| extension: | ||
| id: selftest | ||
| name: Spec Kit Self-Test Utility | ||
mnriem marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| version: 1.0.0 | ||
| description: Verifies catalog extensions by programmatically walking through the discovery, installation, and registration lifecycle. | ||
| author: spec-kit-core | ||
| repository: https://github.com/github/spec-kit | ||
| license: MIT | ||
dhilipkumars marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| requires: | ||
| speckit_version: ">=0.2.0" | ||
| provides: | ||
dhilipkumars marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| commands: | ||
| - name: speckit.selftest.extension | ||
| file: commands/selftest.md | ||
| description: Validate the lifecycle of an extension from the catalog. | ||
mnriem marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.