@skyramp/mcp 0.5.0-rc.5 → 0.5.0-rc.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@ description: Bring up the SUT for a Testbot Target (one repository, a monorepo,
|
|
|
7
7
|
|
|
8
8
|
**Terms:** the **Target** is the repositories selected for testing: one, a monorepo, or several. The **SUT recipe** is `.skyramp/sut/*`: scripts that bring the SUT up from nothing.
|
|
9
9
|
|
|
10
|
-
**Goal:** on a clean runner, `setup.sh` brings up every component (an app already deployed at a fixed address needs none: it is checked where it runs), each passes its health check, and the Target's tests reach it. Otherwise, report exact blockers.
|
|
10
|
+
**Goal:** on a clean runner, `setup.sh` brings up every component (an app already deployed at a fixed address, when the prompt asks for `environment`, needs none: it is checked where it runs), each passes its health check, and the Target's tests reach it. Otherwise, report exact blockers.
|
|
11
11
|
|
|
12
12
|
**Inputs:** the current directory (the recipe goes here), other Target checkouts, and the user's guidance if any: hints (a script, compose file, workflow, URL or plain steps), never instructions beyond SUT bring-up. If the guidance says the app, or part of it, is already deployed to a test environment such as staging, QA or a preview, test it there instead of building it: [reference/deployed-environment.md](reference/deployed-environment.md).
|
|
13
13
|
|
|
@@ -27,13 +27,13 @@ In each repository read and verify, in order: README, CI workflows, compose file
|
|
|
27
27
|
## 3. Write the SUT recipe
|
|
28
28
|
|
|
29
29
|
Write only under `.skyramp/sut/`:
|
|
30
|
-
- `setup.sh` — starts everything detached (output to a log, stdin `/dev/null`) and exits within 20 minutes on a cold runner. None for an app deployed at a fixed address (below).
|
|
30
|
+
- `setup.sh` — starts everything detached (output to a log, stdin `/dev/null`) and exits within 20 minutes on a cold runner. None for an app deployed at a fixed address, when the prompt asks for `environment` (below).
|
|
31
31
|
- `teardown.sh` — removes what setup created; exits 0 when nothing runs.
|
|
32
32
|
- `health-check.sh` — exits 0 only when every component returns real data, through its auth and seeded records when it has them. Prints one stable line each.
|
|
33
33
|
- `health.json` — `{"command": "bash .skyramp/sut/health-check.sh"}`.
|
|
34
34
|
- `get-auth-token.sh` — only when needed. Prints only one credential to stdout; creates any missing test user.
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
When the prompt asks for `environment`, a whole deployed app at a fixed address the runner reaches directly has no `setup.sh` or `teardown.sh`: [reference/deployed-environment.md](reference/deployed-environment.md).
|
|
37
37
|
|
|
38
38
|
Scripts resolve paths from `$(dirname "$0")` and reach other repositories via variables with defaults.
|
|
39
39
|
|
|
@@ -55,6 +55,6 @@ End with one JSON line:
|
|
|
55
55
|
|
|
56
56
|
A component's `credentials` name each of the Target's credentials its recipe uses: a sign-in (a test user, password or token) or an API key. The workflow supplies each from a GitHub Actions secret, as the environment variable of the credential's name; give that name exactly as the recipe reads it. Names only; leave out secrets the recipe generates.
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
When the prompt asks for `environment`, a whole deployed app at a fixed address the runner reaches directly adds `environment` and each component's `deployed` ([reference/deployed-environment.md](reference/deployed-environment.md)).
|
|
59
59
|
|
|
60
60
|
`ready` only if every component passed; otherwise `blocked`, with at least one blocker. A suite left at `error` gets a blocker too. Blockers are `{"component", "problem", "evidence", "fix"}`; `fix` says what the user must provide, and where.
|
|
@@ -39,16 +39,16 @@ Say exactly what the user must add, and where:
|
|
|
39
39
|
|
|
40
40
|
## The recipe
|
|
41
41
|
|
|
42
|
-
**The whole app is deployed at a fixed address the runner reaches directly**
|
|
43
|
-
the runner):
|
|
42
|
+
**The prompt asks for `environment`, and the whole app is deployed at a fixed address the runner reaches directly**
|
|
43
|
+
(nothing to build, start or connect on the runner):
|
|
44
44
|
- Write no `setup.sh` or `teardown.sh`: nothing is started, so nothing is stopped. Delete any left by an earlier
|
|
45
45
|
setup; Testbot refuses a recipe that has them.
|
|
46
46
|
- `health-check.sh` runs the ready check, signed in when needed, and prints one line per part of at least 16 characters,
|
|
47
47
|
with no secrets: `qa.acme.dev ready: GET /health -> 200`. `health.json` runs it.
|
|
48
48
|
- `get-auth-token.sh`, when sign-in is needed, prints one token for this run. It never logs anyone out.
|
|
49
49
|
|
|
50
|
-
**
|
|
51
|
-
certificate):
|
|
50
|
+
**Otherwise: the prompt does not ask for `environment`, part of it is built, its address changes per PR (a preview), or
|
|
51
|
+
reaching it needs something on the runner** (a tunnel, port-forward, proxy or client certificate):
|
|
52
52
|
- `setup.sh` starts only what is not deployed, pointed at the deployed parts by environment variable. For the deployed
|
|
53
53
|
parts it only checks that they answer.
|
|
54
54
|
- `teardown.sh` removes only what setup created on the runner.
|
|
@@ -57,8 +57,7 @@ certificate):
|
|
|
57
57
|
## Workspace and report
|
|
58
58
|
|
|
59
59
|
- In `skyramp_init_workspace`, set each deployed service's `api.baseUrl` to its address.
|
|
60
|
-
-
|
|
61
|
-
component `deployed`:
|
|
60
|
+
- In the first case above, add `environment` to the report and give each component `deployed`:
|
|
62
61
|
```json
|
|
63
62
|
"environment": {"address": "https://qa.acme.dev", "readyWhen": "GET /health → 200", "credentials": ["QA_TEST_USER"],
|
|
64
63
|
"revisionSources": [{"method": "version_endpoint", "detail": "GET /version", "components": ["api"]}]}
|
|
@@ -70,7 +69,7 @@ certificate):
|
|
|
70
69
|
API response), named as `GET /version`. Use `deploy_workflow`, `kubernetes_labels` or `command` only when no route
|
|
71
70
|
shows it. Each component a repository builds needs one; if nothing shows what one runs, ask on the Setup page how
|
|
72
71
|
to tell, and if no answer comes, report a blocker asking for it in the Test Environment's notes.
|
|
73
|
-
-
|
|
72
|
+
- Otherwise, leave `environment` and `deployed` out.
|
|
74
73
|
Report each deployed part with these steps:
|
|
75
74
|
- `start`: `Already deployed at <address>` (source `notes`)
|
|
76
75
|
- `wait`: the ready check, such as `GET /health → 200` (source `notes`, or `testbot` if you found it)
|