Skip to content

Commit 1777448

Browse files
committed
feat(extensions): add core selftest utility and migrate away from manual tests sandbox
1 parent 9fe81a9 commit 1777448

9 files changed

Lines changed: 93 additions & 141 deletions

File tree

extensions/catalog.json

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,18 @@
22
"schema_version": "1.0",
33
"updated_at": "2026-02-03T00:00:00Z",
44
"catalog_url": "https://raw.githubusercontent.com/github/spec-kit/main/extensions/catalog.json",
5-
"extensions": {}
6-
}
5+
"extensions": {
6+
"selftest": {
7+
"name": "Spec Kit Self-Test Utility",
8+
"version": "1.0.0",
9+
"description": "Verifies catalog extensions by programmatically walking through the discovery, installation, and registration lifecycle.",
10+
"author": "spec-kit-core",
11+
"repository": "https://github.com/github/spec-kit",
12+
"tags": [
13+
"testing",
14+
"core",
15+
"utility"
16+
]
17+
}
18+
}
19+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
description: "Validate the lifecycle of an extension from the catalog."
3+
---
4+
5+
# Extension Self-Test: `$ARGUMENTS`
6+
7+
This command drives a self-test simulating the developer experience with the `$ARGUMENTS` extension.
8+
9+
## Goal
10+
11+
Validate the end-to-end lifecycle (discovery, installation, registration) for the extension: `$ARGUMENTS`.
12+
If `$ARGUMENTS` is empty, you must tell the user to provide an extension name, for example: `/speckit.selftest linear`.
13+
14+
## Steps
15+
16+
### Step 1: Catalog Discovery Validation
17+
18+
Check if the extension exists in the Spec Kit catalog.
19+
Execute this command and verify that `$ARGUMENTS` appears in the results. If the command fails or returns no results, fail the test.
20+
21+
```bash
22+
specify extension search $ARGUMENTS
23+
```
24+
25+
### Step 2: Simulate Installation
26+
27+
Simulate adding the extension to the current workspace configuration.
28+
29+
```bash
30+
specify extension add $ARGUMENTS
31+
```
32+
33+
### Step 3: Registration Verification
34+
35+
Once the `add` command completes, verify the installation by checking the project configuration.
36+
Use terminal tools (like `cat`) to verify that the following file contains an enabled record for `$ARGUMENTS`.
37+
38+
```bash
39+
cat .specify/extensions.yml
40+
```
41+
42+
### Step 4: Verification Report
43+
44+
Analyze the standard output of the three steps.
45+
Generate a terminal-style test output format detailing the results of discovery, installation, and registration. Return this directly to the user.
46+
47+
Example output format:
48+
```text
49+
============================= test session starts ==============================
50+
collected 3 items
51+
52+
test_selftest_discovery.py::test_catalog_search [PASS/FAIL]
53+
Details: [Provide execution result of specify extension search]
54+
55+
test_selftest_installation.py::test_extension_add [PASS/FAIL]
56+
Details: [Provide execution result of specify extension add]
57+
58+
test_selftest_registration.py::test_config_verification [PASS/FAIL]
59+
Details: [Provide execution result of reading .specify/extensions.yml]
60+
61+
============================== [X] passed in ... ==============================
62+
```

extensions/selftest/extension.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
schema_version: "1.0"
2+
extension:
3+
id: selftest
4+
name: Spec Kit Self-Test Utility
5+
version: 1.0.0
6+
description: Verifies catalog extensions by programmatically walking through the discovery, installation, and registration lifecycle.
7+
author: spec-kit-core
8+
repository: https://github.com/github/spec-kit
9+
license: MIT
10+
requires:
11+
speckit_version: ">=0.1.0"
12+
provides:
13+
commands:
14+
- name: speckit.selftest
15+
file: commands/selftest.md
16+
description: Validate the lifecycle of an extension from the catalog.

tests/extension-commands/.specify/deploy.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

tests/extension-commands/.specify/extensions.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

tests/extension-commands/.specify/lint.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

tests/extension-commands/TESTING.md

Lines changed: 0 additions & 57 deletions
This file was deleted.

tests/extension-commands/extension.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

tests/extension-commands/main.py

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)