-
Notifications
You must be signed in to change notification settings - Fork 6.4k
test: experimental tests for extension commands #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
base: main
Are you sure you want to change the base?
Changes from all commits
00a2ff3
c39ac52
d0abf8a
524e8e5
ea3a460
31f22ed
9200a91
258d2c7
6dd356b
c88695d
9d5649a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,5 +2,18 @@ | |
| "schema_version": "1.0", | ||
| "updated_at": "2026-02-03T00:00:00Z", | ||
| "catalog_url": "https://raw.githubusercontent.com/github/spec-kit/main/extensions/catalog.json", | ||
| "extensions": {} | ||
| } | ||
| "extensions": { | ||
| "selftest": { | ||
| "name": "Spec Kit Self-Test Utility", | ||
| "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", | ||
| "tags": [ | ||
| "testing", | ||
| "core", | ||
| "utility" | ||
| ] | ||
| } | ||
|
Comment on lines
+6
to
+17
|
||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| --- | ||
| 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.run linear`. | ||
|
|
||
| ## Steps | ||
|
|
||
| ### Step 1: Catalog Discovery Validation | ||
|
|
||
| Check if the extension exists in the Spec Kit catalog. | ||
| Execute this command and verify that `$ARGUMENTS` appears in the results. If the command fails or returns no results, fail the test. | ||
|
|
||
| ```bash | ||
| specify extension search "$ARGUMENTS" | ||
| ``` | ||
|
|
||
| ### Step 2: Simulate Installation | ||
|
|
||
| Simulate adding the extension to the current workspace configuration. | ||
|
|
||
| ```bash | ||
| specify extension add "$ARGUMENTS" | ||
| ``` | ||
|
Comment on lines
+25
to
+31
|
||
|
|
||
| ### 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 an enabled record for `$ARGUMENTS`. | ||
|
|
||
| ```bash | ||
| cat .specify/extensions.yml | ||
| ``` | ||
|
|
||
| ### 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] | ||
|
|
||
| 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 reading .specify/extensions.yml] | ||
|
|
||
| ============================== [X] passed in ... ============================== | ||
| ``` | ||
| 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 | ||
|
Comment on lines
+1
to
+4
|
||
| 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 | ||
| requires: | ||
| speckit_version: ">=0.1.0" | ||
| provides: | ||
| commands: | ||
| - name: speckit.selftest.run | ||
| file: commands/selftest.md | ||
| description: Validate the lifecycle of an extension from the catalog. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated_atwas not bumped even though the catalog contents changed. Please update the rootupdated_attimestamp to reflect this modification (and keep it in sync with any per-extensionupdated_atfields if you add them).